All tutorials

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

  1. 01Create three “last run” variables and three intervals.
  2. 02Test each one independently inside loop().
  3. 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