Best Answer Gutworks, 19 January 2013 - 05:01 AM
This is the code: ( i do not have onboard led choice)
// write your code hereOutputPort led = new OutputPort((Cpu.Pin)22, false);while (true){led.Write(true); // turn on the LEDThread.Sleep(250); // sleep for 250msled.Write(false); // turn off the ledThread.Sleep(250); // sleep for 250 ms}Thank you for your help.
Hi Denisetoo,
I don't think your code sample will work using OutputPort led = new OutputPort((Cpu.Pin)22, false);
Generally the correct way to access the onboard led is to use Pins.ONBOARD_LED. When you first start typing the Pins class as an argument, Intellisense should give you a list of available options, one of which being the ONBOARD_LED.
With that said, this unfortunately will still not work as the blue leds beside each port, are reserved at the moment and until a future update cannot be blinked unlike the ONBOARD_LED of the other Netduino boards. There are a couple of ways around this, but it's a bit of a hack.
However I do have some good news; you can access the white PowerLed
To do so you use this declare you led like so:
OutputPort led = new OutputPort(Pins.PowerLed, false);
The rest of your code should remain the same.
P.S. One little interesting trick with the latest shield base autodetect firmware is that if you connect a Shield Base to a port you'll notice that you now can use OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); and the blue Goport LED will blink
Cheers,
Steve
Go to the full post