Example for blinking the onboard LED.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
//Libraries that our program uses using System; //use base classes using System.Threading; //use threading classes using Microsoft.SPOT; //use smart personal objects technology classes using Microsoft.SPOT.Hardware; //use hardware related SPOT classes using SecretLabs.NETMF.Hardware; //use Secret Labs hardware framework using SecretLabs.NETMF.Hardware.Netduino; //use the Netduino specific classes namespace NCIR01 /// Define the namespace we are in /// { public class Program { public static void Main() /// The Main loop (run at power up) /// { /// Setup Portion of Program, runs once at /// OutputPort led = new OutputPort(Pins.GPIO_PIN_D13, false); //define our LED as being connected to pin 13 while (true) /// Do Forever /// { led.Write(true); //turn led on Thread.Sleep(250); //wait 250 milliseconds led.Write(false); //turn light off Thread.Sleep(250); //wait 250 milliseconds } /// Close Forever Loop /// } /// Close the Main() Loop /// } /// Close the Program Loop /// } /// Close the Namespace Loop /// |