Display Text on the LED Matrix
What you'll build¶
Your first micro:bit program: scroll a greeting across the 5×5 LED matrix, then flash a heart — forever.
Code¶
| 1 display string.py | |
|---|---|
How it works¶
display.scroll()slides a string across the LEDs one column at a time and returns when the text has passed.display.show(Image.HEART)draws one of the built-in images instantly.sleep(2000)pauses for 2000 milliseconds (2 seconds) before the loop starts again.
Try this next¶
- Change the message to your own name.
- Pass
delay=60todisplay.scroll()to make the text scroll faster. - Show a different built-in image — see Display Built-in Images.