🛠 Apprivoiser la matrice LED 12x8 intégrée
Objectives
Control the card's signature: a 96-LED matrix (12 columns × 8 rows) soldered onto the board, driven via multiplexing directly by the RA4M1 — the columns are connected to pins 12 to 23 (pins A0 to A3 are shared with the matrix) and the rows to GPIOs 24 to 31, which are not exposed on the connectors. You will light up columns, understand bit masking, and then display an animation.
Hardware
- 1 Arduino UNO R4 WiFi + USB-C cable
- No soldering, no components: everything is built-in. Since pins 12 to 23 also serve as I/O, avoid wiring them while the matrix is displaying something.
Complete code
#include "Arduino_LED_Matrix.h"
ArduinoLEDMatrix matrix;
void setup {
matrix.begin;
}
void loop {
// Balayage : une colonne allumée qui se déplace.
for (uint8_t col = 0; col < 12; col++) {
matrix.beginFrame;
for (uint8_t c = 0; c < 12; c++) {
// Chaque setColumn reçoit un octet = masque des 8 lignes,
// bit de poids faible = ligne du bas.
matrix.setColumn(c, c == col ? B11111111 : B00000000);
}
matrix.show;
delay(80);
}
}
The official Arduino_LED_Matrix library also provides matrix.loadFrame(...) for 32-bit encoded frames, and the AnimationEngine class with ready-to-use modes (SCROLLING, THROBBING, BLINKING). To draw without coding, the online editor Arduino Labs (labs.arduino.cc, LED Matrix tool) generates the frame arrays to paste into the sketch.
Expected verification
A vertical bar sweeps across the matrix from left to right in a loop. Test B10000001 instead of B11111111: only the first and last bits light up, confirming bit-by-bit reading (LSB = bottom row).
Common errors
- Forgetting
matrix.beginin setup: the matrix remains off, with no error message. - Confusing
setColumn(8-bit mask, one column) with an x,y coordinate: there is nosetPixelin the low-level API. - Modifying pins 12 to 23 (including A0 to A3) during display: the matrix flickers or displays garbage, because multiplexing constantly reads these pins.
- Looking for the matrix on an I²C bus: it is wired directly to GPIO, unlike classic matrix modules such as MAX7219.
- Writing a scan in loop without
beginFrame/show: without these calls, no complete image is transferred.
Other tutorials for this board
- Premier Blink sur la UNO R4 WiFi : la première UNO 32 bits
- Toucher capacitif : touchRead sans composant
- Se connecter au WiFi et lire l'heure NTP (WiFiS3)
- Inclinomètre sur la matrice : l'IMU LSM6DSV16X en I²C
- Serveur web embarqué : piloter la matrice depuis le navigateur
- Horloge persistante : RTC à pile + resynchronisation NTP
Code examples for this board
clignotante.inoArduinobouton-poussoir.inoArduinodac-analogique.inoArduinoentree-analogique.inoArduinopwm-respiration.inoArduinoservo-balayage.inoArduino