Control the led blinking frequency with a potentiometer :
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.NetduinoPlus;
namespace NetduinoPlusApplication1
{
public class Program
{
public static void Main()
{
OutputPort blu_led = new OutputPort(Pins.GPIO_PIN_D0, false);
//AnalogInput pot = new Microsoft.SPOT.Hardware.AnalogInput(SecretLabs.NETMF.Hardware.NetduinoPlus.AnalogChannels.ANALOG_PIN_A0);
AnalogInput pot = new AnalogInput(AnalogChannels.ANALOG_PIN_A0);
int pot_value = 0;
while (true)
{
pot_value = (int) (pot.Read() * 255);
Debug.Print(pot_value.ToString());
Debug.Print(pot.Read().ToString());
blu_led.Write(false);
Thread.Sleep(pot_value);
blu_led.Write(true);
Thread.Sleep(pot_value);
}
}
}
}