#define ledH 13
#define ledB 12
#define ledM 11
#define tombol 7
int status = 0;
void setup()
{
pinMode(ledH, OUTPUT);
pinMode(ledB, OUTPUT);
pinMode(ledM, OUTPUT);
pinMode(tombol, INPUT);
digitalWrite(ledH, LOW);
digitalWrite(ledB, LOW);
digitalWrite(ledM, LOW);
}
void loop()
{
if (digitalRead(tombol) == HIGH) {
status++;
delay(100);
}
if (status == 1) {
digitalWrite(ledH, HIGH);
}
else if (status == 2){
digitalWrite(ledB, HIGH);
}
else if (status == 3){
digitalWrite(ledM, HIGH);
}
else if (status == 4){
status = 0;
}
else{
digitalWrite(ledH, LOW);
digitalWrite(ledB, LOW);
digitalWrite(ledM, LOW);
}
}