Hello everybody. help me how
stop execution of this emergency led1On after digitalRead (button2Pin) == LOW
after
translate led1Pin, LOW
second
if digitalRead (button3Pin) == LOW
also urgently stop
led1On
but don't do lastButton = LOW;
until after digitalRead (button3Pin) == LOW there is digitalRead (button2Pin) == LOW
if (digitalRead(button2Pin) == HIGH && lastButton == LOW){ timer = true; led2OnTime = millis(); lastButton = HIGH; ledOff = true; } if(timer) if (millis() - led2OnTime >= 1000){ digitalWrite(led2Pin, HIGH); digitalWrite(led1Pin, LOW); led2On = true; led1On = true; led2OnTime = millis(); timer = false; } if(led2On) if(millis() - led2OnTime >= 1200) { digitalWrite(led2Pin, LOW); led2On = false; } if(led1On) if(millis() - led2OnTime >= 200) { digitalWrite(led1Pin, HIGH); if(millis() - led2OnTime >= 5000) { digitalWrite(led1Pin, LOW); led1On = false; lastButton = LOW; // ledOff = true; } }