Created
July 22, 2015 09:20
-
-
Save prasertsakd/3e2837557f1ac00f394c 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
int ledPin; | |
int timeDelay; | |
int ledup = {6,7,8,9,10,11,12,13,12,11,10,9,8,7,6}; | |
void setup() { | |
for (ledPin = 0;ledPin<=8;ledPin++) { | |
pinMode( ledup[ledPin], OUTPUT); | |
} | |
} | |
void loop() { | |
for (ledPin = 0;ledPin<=14;ledPin++) { | |
int timeDelay = analogRead(A3); | |
blinky( ledup[ledPin] , timeDelay); | |
} | |
} | |
void blinky( int pin ,int wait_time) { | |
digitalWrite( pin, HIGH); | |
delay( wait_time ); | |
digitalWrite( pin, LOW); | |
//delay( wait_time ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment