Jorge Ramírezbryan costanichAdrian Stevens
Published © Apache-2.0

Getting Started with Netduino by Controlling the Onboard LED

You have all this C# coding knowledge and you want build hardware gadgets. Try Netduino, which is basically a powerful Arduino running .Net!

BeginnerFull instructions provided4,451

Things used in this project

Hardware components

Netduino
Wilderness Labs Netduino
×1

Software apps and online services

Visual Studio 2015
Microsoft Visual Studio 2015

Story

Read more

Code

Netduino Blinky Code

C#
Paste this code into your Main method. What It will do is make the onboard LED to turn on and off for intervals of 250 milliseconds.
using System.Threading;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

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
            }
        }
    }
}

Credits

Jorge Ramírez

Jorge Ramírez

74 projects • 76 followers
Developer advocate for Wilderness Labs.
bryan costanich

bryan costanich

70 projects • 55 followers
Adrian Stevens

Adrian Stevens

70 projects • 45 followers

Comments