Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- using Microsoft.SPOT;
- using Microsoft.SPOT.Hardware;
- using NetduinoGo;
- using SecretLabs.NETMF.Hardware;
- using SecretLabs.NETMF.Hardware.NetduinoGo;
- using Button = NetduinoGo.Button;
- namespace NetduinoGo_Test
- {
- public class Program
- {
- public static void Main()
- {
- RgbLed led = new RgbLed();
- //Button button1 = new Button(GoSockets.Socket1);
- //Button button2 = new Button(GoSockets.Socket3);
- Potentiometer pot = new Potentiometer();
- int muliplier = 2000;
- while(true)
- {
- for (int i = 0; i < 5; i++)
- {
- led.SetColor(255, 0, 0);
- Thread.Sleep(20 * (int)(pot.GetValue() * 100));
- led.SetColor(0, 0, 0);
- Thread.Sleep(40 * (int)(pot.GetValue() * 100));
- }
- Thread.Sleep((int)(pot.GetValue() * muliplier));
- for (int i = 0; i < 5; i++)
- {
- led.SetColor(0, 0, 255);
- Thread.Sleep(20 * (int)(pot.GetValue() * 100));
- led.SetColor(0, 0, 0);
- Thread.Sleep(40 * (int)(pot.GetValue() * 100));
- }
- Thread.Sleep((int)(pot.GetValue() * muliplier));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment