const int LED_PINS[] = {5,18,19,21} ;
const int NUM_LEDS = sizeof(LED_PINS)/sizeof(int) ;
#define OFF (LOW)
#define ON (HIGH)
void setup() {
// put your setup code here, to run once:
for (int i=0 ; i < NUM_LEDS ; i++) {
pinMode(LED_PINS[i], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
int i = 0;
for ( i ; i < NUM_LEDS ; i++){
digitalWrite(LED_PINS[i],ON);
delay(1000);
}
if (i == NUM_LEDS) {
for ( i-- ; i >= 0; i--){
digitalWrite(LED_PINS[i],OFF);
delay(1000);
}
}
}