Skip to content

Instantly share code, notes, and snippets.

@boxalljohn
Created July 15, 2013 00:26
Show Gist options
  • Save boxalljohn/5996738 to your computer and use it in GitHub Desktop.
Save boxalljohn/5996738 to your computer and use it in GitHub Desktop.
Example 3.1
// example 3.1
void setup()
{
pinMode (2, OUTPUT); // set pin 2 as an output pin
}
void loop()
{
for (int i = 1; i<=20; i++) // loop 20 times
{
digitalWrite (2, HIGH); // turn on pin2 for 1 second, then off for one second
delay (1000);
digitalWrite (2, LOW);
delay (1000);
}
delay (2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment