Data to be displayed on the LED matrix. Valid inputs are:
character string — Lights the LEDs based on the text or character
mentioned.
scalar — Lights a single LED using linear addressing.
vector — Lights a single LED, defined using a 1-by-2 vector that gives the
horizontal and vertical coordinates of the LED to be lit.
matrix — One of the following:
MATLAB® matrix functions like ones,
eye, and so on, which represent a pattern of ones in an
array. A limit of 5-by-5 needs to be considered if you are using these
functions to create the matrix.
A 5-by-n matrix, where n ≥ 5, and the matrices created using MATLAB functions like horzcat, which represent
concatenation of arrays. You need to specify the scrolling speed so that all
the columns scroll in the display.
Note
In the matrix, a value of 0 indicates that the LED is off, and a value of 1
indicates that the LED is on.
MicrobitImages.image name — An image
from the BBC micro:bit library. The following table shows the supported names of
images based on the category.
Image Names
| Category | Name of Image |
|---|
| Face | HappyFace | SadFace |
| NeutralFace | ShockedFace |
| SurprisedFace | |
| Arrow with direction | ArrowNorth | ArrowNorthEast |
| ArrowEast | ArrowSouthEast |
| ArrowSouth | ArrowSouthWest |
| ArrowWest | ArrowNorthWest |
| Dice | OneOnDice | TwoOnDice |
| ThreeOnDice | FourOnDice |
| FiveOnDice | SixOnDice |
| All upper case letters | A ….…... Z |
| All lowercase letters | a ….….…. z |
| All single digit numbers | Zero One Two .….. Nine |
| Heart | Heart | FilledHeart |
Note
Float data types like single and double are not supported for the
data argument.
Example: writeLED(m,"THIS is micro:bit", 'ScrollingSpeed',
5)
Example: writeLED(m, '>')
Example: writeLED(m, 'M')
Example: writeLED(m,7)
Example: writeLED(m,[2
2])
Example: writeLED(m, eye(5))
Example: writeLED(m, horzcat(eye(5),ones(5)), 'ScrollingSpeed',
4)
Example: writeLED(m, MicrobitImages.Heart)
Example: writeLED(m, MicrobitImages.M)