Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net;
- using System.Net.Sockets;
- using System.Threading;
- using Microsoft.SPOT;
- using Microsoft.SPOT.Hardware;
- using SecretLabs.NETMF.Hardware;
- using SecretLabs.NETMF.Hardware.Netduino;
- namespace PWM_Xmas_Lights
- {
- public class Program
- {
- public static void Main()
- {
- PWM ch0 = new PWM(PWMChannels.PWM_ONBOARD_LED, 1000, 0, false);
- PWM ch1 = new PWM(PWMChannels.PWM_PIN_D3,1000,0,false);
- ch1.Start();
- ch1.DutyCycle = .5;
- for (double i = 0; i < .75; i+=.05)
- {
- ch1.DutyCycle = i;
- Thread.Sleep(400);
- }
- for (double j = 1; j > 0; j-=.05)
- {
- ch1.DutyCycle = j;
- Thread.Sleep(400);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement