Has anyone recieved an error from trying an AnalogInput command in visual studio 2010 express?
Here is my code, its from an example from the book I purchased.
using System.Threading; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware.Netduino; namespace POT_LED { public class Program { public static void Main() { OutputPort led = new OutputPort(Pins.GPIO_PIN_D0, false); AnalogInput pot = new AnalogInput(Pins.GPIO_PIN_A0); int potValue = 0; while (true) { // read the value of the potentiometer potValue = pot.Read(); // blink the led based on the potentiometer's value (0-1023ms) led.Write(true); Thread.Sleep(potValue); led.Write(false); Thread.Sleep(potValue); } } } }
thanks in advance for any help.