Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Threading;
- using Microsoft.SPOT;
- using Microsoft.SPOT.Hardware;
- namespace ShieldBase_PWMTest
- {
- public class Program
- {
- public static void Main()
- {
- PWM led = new PWM(Cpu.PWMChannel.PWM_3, 1000, 0.5, false);
- led.Start();
- for (int i = 0; i < 100; i++)
- {
- Debug.Print(i.ToString());
- led.Stop();
- led.DutyCycle = i; //EXCEPTION
- led.Start();
- Thread.Sleep(100);
- }
- }
- }
- }
- /*
- Throws:
- An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.PWM.dll
- */
Advertisement
Add Comment
Please, Sign In to add comment