Skip to the content.

Green light red light MicroCode program

This is the classic ‘green light, red light’ game where players to try to reach the leader without being caught moving while the ‘light is red’. This is a game played with multiple micro:bit. The leader presses on the logo to enter leader mode, and press button A or B to switch between green and red mode. The current game mode is transmitted via radio so that every player micro:bit knows when it has to start checking for movement.

page 1 page 1

green light red light page 1 program

This is the green light player mode page.

when logo press, switch to page 2

when radio receive 2, switch to page 3

when page start, show run animation when page start, play hello sond

page 2 page 2

green light red light page 2 program

This is the leader mode page.

page 3 page 3

green light red light page 3 program

This is the player red light page. The player looses if moving in this phase.

when shake detected, show game over animation when shake detected, play unhappy sound

when radio 1 received, switch to page 1