Challenge 1: Reaction timer

Write a game that allows you to test your reaction speed. The program works as follows:

The following video shows the desired output for a single trial.

Screencast 2022-01-18 19_23_04.mp4

Hints:

This line of code can be used to wait until a button is pressed:

while not input.button_is_pressed(Button.A): pass

The device has an onboard clock. The current clock value can be read as follows.

time = input.running_time()

The following code shows a number on the “screen”.

basic.show_number(number)

The following page lists all the icons or images you can show on the LEDs of the device:

https://microbit-micropython.readthedocs.io/en/v1.0.1/tutorials/images.html

Challenge 2: Counter

Make a counter that increases every time you press the A button. The current value of the counter is shown by the number of LEDs that are switched on. When the number gets larger than 25 (the number of LEDs), it resets to zero. When the B button is pressed, the count is reset to zero.