in the more general case, you might benefit from studying state machines.
Here is a small introduction to the topic: Yet another Finite State Machine introduction
and you should look at dealing with millis() if you don't want to block your code. See
in the more general case, you might benefit from studying state machines.
Here is a small introduction to the topic: Yet another Finite State Machine introduction
and you should look at dealing with millis() if you don't want to block your code. See