Help about "if"

You can't do anything during a delay().

But you can use a millis() timer (like the Blink Without Delay Example) in a "do-nothing" loop (probably a while() loop) with an if-statement to break out of the loop when the button is pressed. Or, you can use set-up a condition where the loop runs until the time is up, or the button is pushed.

1 Like