Blinky is the much revered “Hello, World” app for Netduino.

It illustrates a basic program flow in Netduino and how to make the onboard LED blink.

Code

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.Threading;

namespace Blinky
{
    public class Program
    {
        public static void Main()
        {
            // create an output port (a port that can be written to) and wire it to the onboard LED
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);

            // run forever
            while (true)
            {
                led.Write(true); // turn on the LED
                Thread.Sleep(250); // sleep for 250ms
                led.Write(false); // turn off the LED
                Thread.Sleep(250); // sleep for 250ms
            }
        } 
    }
}

Netduino Samples Github Repository

Full source code for all of the samples can be found in the Netduino Samples repository on Github.

 


These docs are open source. If you find an issue, please file a bug, or send us a pull request. And if you want to contribute, we'd love that too!