// common cathoda, HIGH nyala, ke GND
// cathoda ke GND
// anoda ke pin
// Nama : Bakri Ahmad Ridhwan
// NIM : 23.21.1576
// Kelas : Transfer
#define satu 23
int pinLED[] = {22, 23, 24, 25, 26, 27, 28, 29};
int jumlahPIN = 8;
void setup() {
// put your setup code here, to run once:
for (int x = 0; x < jumlahPIN; x++) {
pinMode(pinLED[x], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
for (int x = 0; x < jumlahPIN; x++) {
digitalWrite(pinLED[x], HIGH);
delay(100);
digitalWrite(pinLED[x], LOW);
delay(100);
}
for (int x = jumlahPIN; x > 0; x--) {
digitalWrite(pinLED[x], HIGH);
delay(100);
digitalWrite(pinLED[x], LOW);
delay(100);
}
}