using System.Threading; using HWModules; using Microsoft.SPOT.Hardware; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CPFUnitTests.UT_MotherBoard { [TestClass] public class UnitTest_MotherBoard_EnergyMonitor { [TestMethod] public void TestEnergyMonitorVI() { EnergyMonitorLTC2946 em = new EnergyMonitorLTC2946(new I2CDevice.Configuration(0xDE>>1, 400), EnergyMonitorLTC2946.VoltageSource.Vdd, 0.025, 0.50); int i = 10; while (--i >0 ) { EnergyMonitorLTC2946.EM_VandI data = em.getVandI(); EngrLogger.writeToColumns("EM DATA V/I:" + data.voltage.ToString() + " / " + data.current.ToString()); Thread.Sleep(100); } } [TestMethod] public void TestEnergyMonitorPump() { EnergyMonitorLTC2946 em = new EnergyMonitorLTC2946(new I2CDevice.Configuration(0xDC>>1, 400), EnergyMonitorLTC2946.VoltageSource.Vdd, 0.025, 5.00); int i = 10; while (--i >0 ) { EnergyMonitorLTC2946.EM_VandI data = em.getVandI(); EngrLogger.writeToColumns("PUMP V/I:" + data.voltage.ToString() + " / " + data.current.ToString()); Thread.Sleep(100); } } } }