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 pinArray[] = {3, 5, 6, 9, 10, 11}; | |
//int count = 0; | |
int pinCount = 6; | |
//int timer = 30; | |
int ledFade[6]; | |
int i; | |
int prevTime; | |
int interval = 200; | |
void setup(){ | |
for (i = 0; i < pinCount; i++) { | |
pinMode(pinArray[i], OUTPUT); | |
} | |
Serial.begin(9600); | |
Serial.println(); | |
Serial.println("Begin"); | |
} | |
void loop() { | |
for (i=0;i<5;i++) { | |
digitalWrite(pinArray[i], HIGH); | |
delay(interval); | |
digitalWrite(pinArray[i + 1], HIGH); | |
delay(interval); | |
digitalWrite(pinArray[i], LOW); | |
delay(interval); | |
} | |
for (i=5;i>0;i–) { | |
digitalWrite(pinArray[i], HIGH); | |
delay(interval); | |
digitalWrite(pinArray[i – 1], HIGH); | |
delay(interval); | |
digitalWrite(pinArray[i], LOW); | |
delay(interval); | |
} | |
} |