Various commands can be used to turn the LEDs on and off. One of them is the PLOT command, which can be used to turn a specific LED on. The LEDs are labelled 0 to 4 from left to right (X direction) and 0 to 4 from top to bottom (Y direction).
For example, try this code:
The PLOT command can be used in loops to create patterns. For example, try this:
Here's another example which uses UNPLOT as well as PLOT to make the light go round and round:
In the dice program, sometimes the same number comes up twice in a row. This could be just random chance, or it could be because the microbit wasn't shaken hard enough.
Your task is to improve the program further by making the display flash in some way before the number is displayed, so that you can tell that the shake has been detected.
Be creative with show leds, plot or other blocks to make the leds flash on and off.
Here are some examples:
SIMPLE FLASH
GROW FROM BOTTOM
When finished, download your code to your ROB folder and post the simulator code on your blog.
Can you create a program that runs just like the dice program, but instead of displaying a random number between 1 and 6, it displays a number which has been sent from another microbit?
HINT: Use the 'radio send number' command on one microbit to send the number, and an 'on radio received' command on the microbit that displays the number.