Created
July 15, 2013 00:26
-
-
Save boxalljohn/5996738 to your computer and use it in GitHub Desktop.
Example 3.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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