int ButtonPin= 2;
int LedM = 10;
int LedK = 11;
int LedH = 12;
int LedP = 13;
int buttonState = 0;
void Negus (){
digitalWrite(LedH, LOW);
digitalWrite(LedP, HIGH);
digitalWrite(LedK, HIGH);
delay(1000);
digitalWrite(LedK, LOW);
digitalWrite(LedM, HIGH);
delay(5000);
digitalWrite(LedM, LOW);
digitalWrite(LedP, LOW);
}
void setup() {
// put your setup code here, to run once:
pinMode(ButtonPin, INPUT);
pinMode(LedM, OUTPUT);
pinMode(LedK, OUTPUT);
pinMode(LedH, OUTPUT);
pinMode(LedP, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(ButtonPin);
if(buttonState == LOW){
digitalWrite(LedH, HIGH);
}
else{
Negus();
}
}