Created
July 6, 2016 00:06
-
-
Save marceloneil/35c0b2847834047ee7bfa2831683d5d8 to your computer and use it in GitHub Desktop.
LED show
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
int leds[] = {}; | |
int globalDelay = 100; | |
void setup(){ | |
// Initialize Pins | |
for(int i = 0; i < sizeof(leds); i++){ | |
pinMode(leds[i], OUTPUT); | |
} | |
// Initialize Serial | |
Serial.begin(9600); | |
} | |
void loop(){ | |
// Turn on the leds | |
for(int i = 0; i < sizeof(leds); i++){ | |
digitalWrite(leds[i], HIGH); | |
delay(globalDelay); | |
} | |
// Turn off the leds | |
for(int i = 0; i < sizeof(leds); i++){ | |
digitalWrite(leds[i], LOW); | |
delay(globalDelay); | |
} | |
// Shorten delay | |
if(globalDelay > 25){ | |
globalDelay -= 25; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment