Dears,
I have issue with programming a code which make two action to be executed in parallel.
For example:
Four LED's working sequentially using delay, during that sequence I should turn on another LED at any time when a push button pressed and turn off that LED once the push button released.
I tried If statement but it did not work as I need, it seems I need something else to do or to re-place the if statement.
Kindly help me in this small issue.
Below is my tried code
Note how each function runs very briefly and returns to loop() so the next one can be called. None of the functions tries to complete a task in one call. And there may be dozens of calls to a function before it is actually time for it to do anything.
Also note that it uses millis() to implement non-blocking timing.