Check out our tutorials for the Kitronik STOP:bit and the BBC micro:bit - they're great for kids aged 8 and upwards!
Note: the tutorials reference the Australian traffic light sequence i.e. Green -> Amber -> Red, but can be adapted for other sequences.
In the first tutorial, you'll learn to turn individual coloured lights on and off, with a single traffic light. We'll create a Python function to make our code reusable, and model the different combinations of lights in a state table. Then, repeat your sequence with a loop.
The second tutorial combines two traffic lights to expand the state table for an intersection. Save time by using your Python function from the first tutorial; then add radio communications to coordinate the second traffic light with the first.
The concepts introduced in these tutorials include:
using a function, that takes input to decide which light sequence to display;
modelling sequences in state tables; and
using a stateless radio network to coordinate two separate devices.