Created
December 3, 2015 22:02
-
-
Save zamfi/113ee78ef950394e99e6 to your computer and use it in GitHub Desktop.
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
const int numPins = 12; | |
const int pins[] = {2,3,4,5,6,7,8,9,10,11,12,13}; | |
void setup() { | |
for (int i = 0; i < numPins; ++i) { | |
pinMode(pins[i], OUTPUT); | |
} | |
} | |
int litPin = 0; | |
void loop() { | |
digitalWrite(pins[litPin], LOW); | |
litPin = (litPin + 1) % numPins; | |
digitalWrite(pins[litPin], HIGH); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment