#define LED_hijau 13
#define LED_kuning 12
#define LED_merah 11
#define tombol 7
int status=0;
void setup(){
Serial.begin(9600);
pinMode(LED_hijau, OUTPUT);
pinMode(LED_kuning, OUTPUT);
pinMode(LED_merah, OUTPUT);
pinMode(tombol, INPUT);
digitalWrite(LED_hijau, LOW);
digitalWrite(LED_kuning, LOW);
digitalWrite(LED_merah, LOW);
}
void loop(){
if(digitalRead(tombol)==HIGH){
status++;
delay(100);
}
if (status == 1){
digitalWrite(LED_hijau, HIGH);
digitalWrite(LED_kuning, LOW);
digitalWrite(LED_merah, LOW);
}
else if (status == 2){
digitalWrite(LED_kuning, HIGH);
digitalWrite(LED_hijau, LOW);
digitalWrite(LED_merah, LOW);
}
else if (status == 3){
digitalWrite(LED_merah, HIGH);
digitalWrite(LED_kuning, LOW);
digitalWrite(LED_hijau, LOW);
}
else if (status == 4){
status = 0;
}
Serial.println(status);
delay(100);
}