Created
October 8, 2011 07:37
-
-
Save bensonk/1271987 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
#define cycleTime 150 | |
void setup() { | |
for(int i = 2; i < 13; i++) | |
pinMode(i, OUTPUT); | |
} | |
void usePin(int pin) { | |
for(int i = 2; i < 13; i++) | |
digitalWrite(i, LOW); | |
digitalWrite(pin, HIGH); | |
} | |
int p = 0; | |
int direction = 1; | |
void loop() { | |
if(p >= 11) direction = -1; | |
if(p <= 2) direction = 1; | |
usePin(p); | |
p += direction; | |
delay(cycleTime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment