Idea
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
- Development Boards
- Semiconductors
- Semiconductors
- PassivesResistor 220 Ω × 2
- Sensors
- Passives
- Prototyping
- Prototyping
How to build it
- Write each job as a small function
- Give each a period
- Check each period against millis
- Run a job only when it is due
- Add a delay to one job and see the others stall
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.
