public static void RunSoftPwmTests() { IDigitalOutputPort digitalOut = MeadowApp.Device.CreateDigitalOutputPort(MeadowApp.Device.Pins.OnboardLedGreen); SoftPwmPort softPwmPort = new SoftPwmPort(digitalOut); // 50% duty cycle softPwmPort.DutyCycle = 0.5f; Console.WriteLine("Testing port at 10hz"); softPwmPort.Frequency = 10; softPwmPort.Start(); Thread.Sleep(2000); Console.WriteLine("Testing port at 25hz"); softPwmPort.Frequency = 25; Thread.Sleep(2000); Console.WriteLine("Testing port at 50hz"); softPwmPort.Frequency = 50; Thread.Sleep(2000); Console.WriteLine("Testing port at 100hz"); softPwmPort.Frequency = 100; Thread.Sleep(2000); softPwmPort.Stop(); }
public SoftPwmPortApp() { IDigitalOutputPort digiOut = Device.CreateDigitalOutputPort(Device.Pins.D00); Console.WriteLine("digital out created"); softPwmPort = new SoftPwmPort(digiOut); Console.WriteLine("SoftPwmPort created"); StartPulsing(); }
public MeadowApp() { Console.WriteLine("Initializing..."); IDigitalOutputPort digiOut = Device.CreateDigitalOutputPort(Device.Pins.D00); softPwmPort = new SoftPwmPort(digiOut); TestSoftPwmPort(); }