#define MAX_LEDS 4
int myPins[MAX_LEDS] = {2,3,8,9};
void setup() {
// put your setup code here, to run once:
for (int i = 0; i<sizeof(myPins); i++){
pinMode(myPins[i], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
for(int i = 0; i<sizeof(myPins)/sizeof(myPins[0]); i++){
digitalWrite(myPins[i], HIGH);
delay(500);
}
for(int i = sizeof(myPins)/sizeof(myPins[0]); i>=0; i--){
digitalWrite(myPins[i], LOW);
delay(500);
}
}