//Mohamad Doddy Sujatmiko_21.11.4344
int8_t ledArr[8] = {22, 23, 24, 25, 26, 27, 28, 29};
void setup() {
for(int8_t led : ledArr){
pinMode(led, OUTPUT);
}
}
void loop() {
for(int8_t i = 0; i < 8; i++){
digitalWrite(ledArr[i], HIGH);
digitalWrite(ledArr[i-1], LOW);
delay(500);
}
for(int8_t i = 7; i >= 0; i--){
digitalWrite(ledArr[i], HIGH);
digitalWrite(ledArr[i+1], LOW);
delay(500);
}
}