const int buttonPin  =  3;     
const int ledPin     = 4;     
const int ledPin1    = 5;
#define waktu 5
//-------------------------------
int  initial    = 0;       
int oldstate    = 0;       
int buttonstate = 0; 


void setup() {
  pinMode(ledPin, OUTPUT); 
  pinMode(ledPin1, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
   buttonstate = digitalRead(buttonPin); 
  if(buttonstate == LOW){               
    delay(waktu);
    buttonstate = digitalRead(buttonPin);
    if(buttonstate == HIGH){              
     initial = oldstate + 1;        
    }
  }else{                       
      }
   switch (initial){               
     case 1:                     
       digitalWrite(ledPin, HIGH);
       digitalWrite(ledPin1, LOW);
       oldstate =  initial;          
       break;
     case 2:
       digitalWrite(ledPin, LOW);
       digitalWrite(ledPin1, HIGH);
       oldstate = 0; 
       break;
}
}