Year 6 noted the order of the lights at a road junction on a class local-area walk earlier in the term, planned under the school's trips policy. In pairs they clip a red, an amber and a green LED to pins 0, 1 and 2 of a micro:bit with crocodile leads, and in MakeCode they code the UK sequence: red, red and amber together, green, amber, then red again, choosing their own timing for each phase. They then add selection: pressing button A starts a pedestrian phase, shown as a walking figure on the board's LED grid, before the cars get green again. Pairs download each version to the board and test it on the desk, fixing the order or the pauses when the lights misbehave. The school taught this unit for years on Crumble controllers with the same LEDs, the same sequence and the same button, and the MakeCode simulator is not used, so every test happens on the real board as it did before.
Tools: micro:bit, MakeCode Nine ideas for your own version in Generate
This page is one of a growing set of PICRAT examples by cell, subject and grade. Page maintained by Andy Perryer.