top of page

ACTIVITY 3

Lightning Challenge

Open MakeCode and load the Diversi:bit extension

Screenshot 2025-06-30 at 19.40.11.png

1

Introduces randomness

In the "Math" section, select "Randomly choose from 0 to 100." Change the values to a time range that works for you (e.g., 1,000 to 10,000) and set it to the first pause value.

3

Decide the winner

Under “Input,” select “when A is pressed.” Inside, add the “If...then” conditional from the “Logic” section and add the variable as a condition.

Screenshot 2025-06-30 at 21.42.06.png

5

Replicate the code
for button B

Screenshot 2025-06-30 at 21.44.29.png

7

Assemble the image blocks

In the "Basic" section, select the blocks. You can change the icon on the screen to a sound to make it more accessible.

Screenshot 2025-06-30 at 21.18.08.png

2

Create a variable

In "Variables," create a new variable. Below the loop you created, add "Set Variable" and set the "Logic" section to "true."

Screenshot 2025-06-30 at 21.38.10.png

4

Within this conditional, you can put whatever you want to identify the winner, but at the end you should always put "Set Variable" and set the value to "False."

Screenshot 2025-06-30 at 21.46.39.png

6

Test your reflexes!

Upload the code to Microbit and choose a partner.

It's time to challenge your teammates and see who has the best reflexes!

8

bottom of page