using System; using Microsoft.SPOT; using System.Text; using System.Threading; using CPF; using CPF.Surface_States; using HWModules; using Microsoft.SPOT.Hardware; using Microsoft.VisualStudio.TestTools.UnitTesting; using SWModules; namespace CPFUnitTests { class StringPotUT { public BuoyancyEngine buoyancyEngine; [TestMethod] public void TestPositionSensor() { HWModules.MotherBoard motherboard = HWModules.MotherBoard.Instance; motherboard.EnableChannelPower(MotherBoard.ChannelNames.PositionSensorChannel); buoyancyEngine = BuoyancyEngine.Instance; double bellowsPosition = -10000.0; for (int i=0; i<100; i++) { bellowsPosition = -10000.0; bellowsPosition = buoyancyEngine.getBellowsPositionStringPot(); Debug.Print(i + "Unit Test Bellows Position = " + bellowsPosition.ToString("f3")); Thread.Sleep(150 - (i%2)*100); } } } }