Controlling individual onboard LED

Each LED on the microbit can be identified by its x and y coordinates as shown on the image below:

x and y coordinate values

To turn on and off the LEDs, use the plot and unplot  blocks under the Led category of the Block Editor.

Turn on the specified LED using x and y coordinates (x is horizontal, y is vertical).

Turn off the specified LED using x and y coordinates (x is horizontal, y is vertical).

As an example, the following program will lit the central led at coordinates (2,2) then blink in a loop with a pause of 500 ms.

The next program blinks the middle LED from top to bottom in a loop.

Leave a Reply

Your email address will not be published. Required fields are marked *