Skip to content

Instantly share code, notes, and snippets.

@aaronamm
Created October 30, 2018 06:49
Show Gist options
  • Save aaronamm/ac324efffa96e0ca0c3e6ce38f8bd146 to your computer and use it in GitHub Desktop.
Save aaronamm/ac324efffa96e0ca0c3e6ce38f8bd146 to your computer and use it in GitHub Desktop.
Getting started Netduino
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.Threading;
namespace NetduinoBlink
{
public class Program
{
const int SLEEP_IN_MILLISECONDS = 250;
public static void Main()
{
// Configure an output port for us to "write" to the LED
OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
// Note that if we didn't have the SecretLabs.NETMF.Hardware.Netduino DLL,
// We could also manually access it this way:
// OutputPort led = new OutputPort(Cpu.Pin.GPIO_Pin10, false);
while (true)
{
led.Write(true); // turn on the LED
Thread.Sleep(SLEEP_IN_MILLISECONDS); // sleep for 250ms
led.Write(false); // turn off the LED
Thread.Sleep(SLEEP_IN_MILLISECONDS); // sleep for 250ms
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment