🛠 Afficher du texte sur la matrice LED 5×5

micro:bit V2 (BBC micro:bit v2) · debutant · Schéma : IMG-microbit-v2-debutant-1-microbit-v2-afficher-texte.svg — Carte micro:bit V2 vue de face avec la matrice LED 5×5 affichant un smiley, câble micro-USB à côté

Objectives

Discover the micro:bit V2 board (Nordic nRF52833, Cortex-M4 64 MHz) by displaying text and images on its 5×5 LED matrix (25 LEDs). By the end of this tutorial, you will know how to flash a MicroPython program via drag-and-drop and scroll a message.

Hardware

Complete code

from microbit import *

# Message défilant, puis images prédéfinies
display.scroll("BONJOUR MICROBIT", delay=80)

while True:
    display.show(Image.HAPPY)
    sleep(800)
    display.show(Image.HEART)
    sleep(800)
    display.show(Image.TARGET)
    sleep(800)

Save from python.microbit.org: the .hex file is copied to the "MICROBIT" USB drive (DAPLink interface chip, KL27Z or nRF52820 depending on revision). The program starts after a short restart.

Expected verification

The message "BONJOUR MICROBIT" scrolls letter by letter, then a smiley, a heart, and a target are displayed in a loop. The board barely heats up: this is normal, as the LEDs are software-multiplexed.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials