GLAM Digital Makers Project

How-to: Code a micro:bit randomiser

Connect your micro:bit to your computer, head to MakeCode, and click New Project!

You will see a screen like this:

annotated MakeCode editor

Displaying a Random Number

The first step is getting a random number, and displaying it on the micro:bit.

on start, set variable to random number, display variable

Test it on the emulator! Click reset to run the code again.

To run your code on the physical micro:bit, click the Download button every time you make changes!

Displaying Words

Step two, is using the random number to choose which words to display on the micro:bit.

if number, display word

Expanding your Code

Now make it your own!

input options