Created
January 24, 2010 00:09
-
-
Save djmitche/284880 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| Originally By David Cuartielles | |
| http://arduino.cc/en/Tutorial/Blink | |
| based on an orginal by H. Barragan for the Wiring i/o board | |
| */ | |
| #define highpin 12 | |
| #define lowpin 7 | |
| // The setup() method runs once, when the sketch starts | |
| void setup() { | |
| for (int i = lowpin; i <= highpin; i++) { | |
| pinMode(i, OUTPUT); | |
| digitalWrite(i, HIGH); | |
| } | |
| } | |
| // the loop() method runs over and over again, | |
| // as long as the Arduino has power | |
| void loop() | |
| { | |
| int i, j; | |
| for (i = lowpin; i <= highpin; i++) { | |
| for (j = lowpin; j <= highpin; j++) { | |
| if (i == j) | |
| digitalWrite(j, LOW); // common anode: on = LOW | |
| else | |
| digitalWrite(j, HIGH); | |
| } | |
| delay(200); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment