5 · Communication & data
Three tasks in parallel
Expert30 min
Goal
Blink, measure and display at three different rates.
Why it matters
A cooperative scheduler fits in 20 lines and never blocks.
Steps
- 01Create three “last run” variables and three intervals.
- 02Test each one independently inside loop().
- 03Check that no delay() is used.
This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.
Next tutorials
- Control the board from the keyboard
Switch the LED on/off with the “on” and “off” commands.
- Log data as CSV
Produce “time;value” lines usable in a spreadsheet.
- Remember after power-off (EEPROM)
Keep a setting even after a restart.
- State machine
Structure a traffic light into explicit states (GREEN, AMBER, RED).