Skip to content

Instantly share code, notes, and snippets.

@boxalljohn
Created July 29, 2013 03:05
Show Gist options
  • Save boxalljohn/6101924 to your computer and use it in GitHub Desktop.
Save boxalljohn/6101924 to your computer and use it in GitHub Desktop.
/* Example 1.1 - using the 'for' command
Created 02/04/2010 --- CC by-sa v3.0 Share the love!
By John Boxall --- http://tronixstuff.com
Blinks LED on digital port 9 five times...
Based on an orginal by H. Barragan for the Wiring i/o board
*/
void setup()
{
pinMode(9, OUTPUT); // initialise the digital pin 9 as an output
}
void loop()
{
for (int wow = 1; wow <= 5; wow++)
{
digitalWrite(9, HIGH); // turn on digital pin 9
delay(1000); // wait a moment
digitalWrite(9, LOW); // turn off digital pin 9
delay(1000); // wait a moment
}
delay(10000); // wait 10 seconds, then the whole thing will start again
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment