Advertisement
Guest User

Untitled

a guest
Dec 27th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. using System.Threading;
  5. using Microsoft.SPOT;
  6. using Microsoft.SPOT.Hardware;
  7. using SecretLabs.NETMF.Hardware;
  8. using SecretLabs.NETMF.Hardware.Netduino;
  9.  
  10. namespace PWM_Xmas_Lights
  11. {
  12. public class Program
  13. {
  14. public static void Main()
  15. {
  16.  
  17. PWM ch0 = new PWM(PWMChannels.PWM_ONBOARD_LED, 1000, 0, false);
  18. PWM ch1 = new PWM(PWMChannels.PWM_PIN_D3,1000,0,false);
  19. ch1.Start();
  20. ch1.DutyCycle = .5;
  21. for (double i = 0; i < .75; i+=.05)
  22. {
  23. ch1.DutyCycle = i;
  24. Thread.Sleep(400);
  25. }
  26. for (double j = 1; j > 0; j-=.05)
  27. {
  28. ch1.DutyCycle = j;
  29. Thread.Sleep(400);
  30. }
  31.  
  32.  
  33.  
  34. }
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement