/* in1 -> pin 13 in2 -> pin 12 in3 -> pin 11 in4 -> pin 10 in5 -> pin 9 in6 -> pin 8 in7 -> pin 7 in8 -> pin 6 */ int pinArray[] = {13, 12, 11, 10, 9, 8, 7, 6}; int count = 0; int timer = 50; void setup(){ for (count=0;count<7;count++) { pinMode(pinArray[count], OUTPUT); } } void loop() { for (count=0;count<8;count++) { digitalWrite(pinArray[count], HIGH); delay(timer); digitalWrite(pinArray[count + 1], HIGH); delay(timer); digitalWrite(pinArray[count], LOW); delay(timer*2); } for (count=7;count>0;count--) { digitalWrite(pinArray[count], HIGH); delay(timer); digitalWrite(pinArray[count - 1], HIGH); delay(timer); digitalWrite(pinArray[count], LOW); delay(timer*2); } } 5