Skip to content

Instantly share code, notes, and snippets.

@prasertsakd
Created July 22, 2015 09:20
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 prasertsakd/3e2837557f1ac00f394c to your computer and use it in GitHub Desktop.
Save prasertsakd/3e2837557f1ac00f394c to your computer and use it in GitHub Desktop.
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