Projects / Ideas / Cooperative scheduler lab

Cooperative scheduler lab

IntermediateDigital LogicIdeaReviewed
In short

How do you build a cooperative scheduler lab?

Three tasks, a blink, a sensor read and a serial report, each run at their own rate without a single delay, using a little scheduler built from the millis clock. It shows how bigger systems share a chip, and why a delay can stall everything else. You need Arduino Nano, LED 5 mm red, LED 5 mm green, Resistor 220 Ω × 2, LDR Photoresistor, Resistor 10 kΩ, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

Level
Intermediate
Time
About 90 min
Parts
8
An idea, not a guided build yet. Goal, parts and steps; no wiring, code or tests. Copy it to My Garage to plan it.
Goal

Run three jobs at three speeds without delay.

Parts list

How to build it

  1. Write each job as a small function
  2. Give each a period
  3. Check each period against millis
  4. Run a job only when it is due
  5. Add a delay to one job and see the others stall

Related projects

Common questions

What parts do I need for the cooperative scheduler lab?

Arduino Nano, LED 5 mm red, LED 5 mm green, Resistor 220 Ω × 2, LDR Photoresistor, Resistor 10 kΩ, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the cooperative scheduler lab take to build?

About 90 minutes for a intermediate maker.