int tombol = 2;
int lampu1 = 3;
int lampu2 = 4;
int Counter;
void setup() {
// put your setup code here, to run once:
pinMode(tombol, INPUT);
pinMode(lampu1, OUTPUT);
pinMode(lampu2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int StatusPower = digitalRead(tombol);
if(StatusPower==HIGH){
Counter ++;
delay(300);
if(Counter==1){
digitalWrite(lampu1, HIGH);
}
else if(Counter==2){
digitalWrite(lampu1, LOW);
digitalWrite(lampu2, HIGH);
}
else if(Counter==3){
digitalWrite(lampu2, LOW);
Counter=0;
}
}
}