#define ledh 2
#define ledk 3
#define ledm 4
#define tombol 6
int status;
void setup()
{
pinMode(ledh, OUTPUT);
pinMode(ledk, OUTPUT);
pinMode(ledm, OUTPUT);
pinMode(tombol, INPUT_PULLUP);
}
void loop()
{
status = digitalRead(tombol);
if(status == 0)
{
digitalWrite(ledh, 1);
digitalWrite(ledk, 0);
digitalWrite(ledm, 0);
delay(1000);
digitalWrite(ledh, 0);
digitalWrite(ledk, 1);
digitalWrite(ledm, 0);
delay(1000);
digitalWrite(ledh, 0);
digitalWrite(ledk, 0);
digitalWrite(ledm, 1);
delay(3000);
}
else
{
digitalWrite(ledh, 1);
digitalWrite(ledk, 0);
digitalWrite(ledm, 0);
}
}