unkwntech

ShieldBase PWM

May 2nd, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System.Threading;
  2. using Microsoft.SPOT;
  3. using Microsoft.SPOT.Hardware;
  4.  
  5. namespace ShieldBase_PWMTest
  6. {
  7.     public class Program
  8.     {
  9.         public static void Main()
  10.         {
  11.             PWM led = new PWM(Cpu.PWMChannel.PWM_3, 100, 0.5, false);
  12.             led.Start();
  13.             for (double i = 0; i < 1; i+=0.001)
  14.             {
  15.                 Debug.Print(i.ToString());
  16.                 led.DutyCycle = i;
  17.                 Thread.Sleep(150);
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment