GamesA Two-Player Reaction Game
An LED lights at a random moment. Whoever presses their button first wins. Built from Student Kit parts in 45 minutes.
GamesShake the micro:bit and a random number from 1 to 6 appears on its display. A first program in 15 minutes, fine for children too.
Written by the RoboHub team. A question? Write to us.
Choose a variation and the parts list updates.
Open makecode.microbit.org in your browser. Nothing to install.
Put “show number” inside the “on shake” block, and “pick random 1 to 6” inside that. In Python the same looks like this:
def on_gesture_shake():
basic.show_number(randint(1, 6))
input.on_gesture(Gesture.SHAKE, on_gesture_shake)Connect the micro:bit by USB and download the program. Copy the file onto the micro:bit as you would onto a USB stick.
Plug a battery holder (2 × AAA) into the board and the dice is ready.

Illustration, made with AI
Illustration: at a school desk a child holds a micro:bit showing a dice five on its LEDs.
Step 4: Play
GamesAn LED lights at a random moment. Whoever presses their button first wins. Built from Student Kit parts in 45 minutes.
GamesFive buttons, five notes: C, D, E, F and G. Press a button and the buzzer plays its note, enough for simple tunes.
SensorsAn ultrasonic sensor measures the distance. Three LEDs show how close the obstacle is, and the buzzer beeps faster the closer you get.