This is an old revision of the document!
Say Hello to the World
Now, let's run our first code, just to make sure everything is in order. Make sure to plug one Sparrow node into its socket on the nest board and connect the nest board to a USB port on your computer. Copy the code below and paste it in the Arduino IDE and then hit the Upload button.
<html><script src=“https://gist-it.appspot.com/github/robertkrimen/gist-it-example/blob/master/example.js”></script></html
/* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We use pin 11 because, * on the Sparrow node it is connected to the green LED * * http://www.arduino.cc/en/Tutorial/Blink */ int ledPin = 11; // LED (PB5) connected to digital pin 11 void setup() // run once, when the sketch starts { pinMode(ledPin, OUTPUT); // sets the digital pin as output } void loop() // run over and over again { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second }
After compiling and uploading, the RGB LED on the Sparrow node should blink green once a second.