Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials_hello_world [2016/04/02 09:41] admin |
tutorials_hello_world [2017/01/06 05:21] (current) admin |
||
---|---|---|---|
Line 5: | Line 5: | ||
Copy the code below and paste it in the Arduino IDE and then hit the Upload button. | Copy the code below and paste it in the Arduino IDE and then hit the Upload button. | ||
- | <html><script src="http://gist-it.appspot.com/github/clkdiv8/sparrow-arduino-blink/blob/master/sparrow-blink/sparrow-blink.ino"></script></html> | + | <html><script src="https://gist.github.com/deathmeek/3fb44730e255ec1ebd5d2863aba831bd.js"></script></html> |
- | + | ||
- | <code C> | + | |
- | /* | + | |
- | * 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 | + | |
- | } | + | |
- | </code> | + | |
After compiling and uploading, the RGB LED on the Sparrow node should blink green once a second. | After compiling and uploading, the RGB LED on the Sparrow node should blink green once a second. | ||
+ | Here is a video tutorial of the whole process: | ||
+ | |||
+ | <html><iframe width="640" height="480" src="https://www.youtube.com/embed/hjFEv6dcr80" frameborder="0" allowfullscreen></iframe></html> | ||
+ | |||
+ | <note tip>Want to know how you can create millions of colors? Check out how [[tutorials_colors|here]]!</note> |