This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

5x5 LED Matrix

Output 5x5 LED image on board

  • Library:
  • Simulink Coder Support Package for BBC micro:bit/ LED


The 5x5 LED Matrix block outputs a 5x5 LED image on a built-in 5x5 LED matrix on the board. The block has one input port, Matrix. The Matrix port accepts a 5x5 matrix with all the elements as either 0 or 1.

Use the 5x5 LED Matrix

The BBC micro:bit uses x, y coordinates to identify a particular LED in the 5x5 matrix. The coordinates start from 0 from the top-left corner of the matrix.

Place the board horizontally on a table with the LEDs facing upwards. The horizontal line represents the x-coordinates and the vertical line represent the y-coordinates.

Suppose that you are sending a matrix with values [1 0 0 0 1;0 1 0 1 0;0 0 1 0 0;0 1 0 1 0;1 0 0 0 1] as an input to the block. All the LEDs corresponding to elements with value 1 turn on.



expand all

The port accepts a 5x5 matrix with all the elements as either 0 or 1. When the element value is greater than 0, the corresponding LED turns on. Otherwise, it turns off.

Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double