Run Two Things at Once
Blink and read a button simultaneously.
The Multitasking Dream
Real devices do many things at once: blink a light while watching a button. With non-blocking timing your board can finally juggle both.
Each Task Gets Its Timer
The trick is one timer per task. Give the blink its own previousMillis and interval, separate from anything else you want to run.
All lessons in this course
- int, float, bool on Arduino
- Why delay() Blocks Everything
- Blink Without delay Using millis
- Run Two Things at Once