Skip to content

Instantly share code, notes, and snippets.

@zamfi
Created December 3, 2015 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamfi/113ee78ef950394e99e6 to your computer and use it in GitHub Desktop.
Save zamfi/113ee78ef950394e99e6 to your computer and use it in GitHub Desktop.
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