🛠 Mur de LEDs et panneaux HUB75 : OctoWS2811, WS2812Serial et SmartMatrix sur le 4.1
Objectives
The Teensy 4.1 is the reference for LED walls thanks to three DMA engines: OctoWS2811 (refreshes 1,920+ LEDs at 30 Hz and, specific to the 4.1, on any number of parallel pins — the 8-pin limit of Teensy 3.x is removed), WS2812Serial (up to 8 non-blocking DMA instances on serial ports) and SmartMatrix (HUB75 panels from 32x16 up to 128x64 with the SmartLED Shield v4/v5). All this with a CPU that remains largely free for animation.
Hardware
- 1 Teensy 4.1 + micro-USB data cable
- WS2812B strips with dedicated 5 V power supply (data remains at 3.3 V: the Teensy powers the data, not the LEDs)
- For HUB75: a SmartLED Shield v4 or v5 and a compatible panel
Key Points
- OctoWS2811 reserves the pins and timers it controls — notably the QuadTimer4 channels, reserved by the library: do not use them elsewhere.
- WS2812Serial is non-blocking: each instance is a dedicated DMA serial port, ideal when animation is running elsewhere.
- SmartMatrix on the 4.1 exploits the nascent Pixel Processing Pipeline — PJRC still describes it as very experimental; the library itself is mature.
- The absolute electrical rule: Teensy pins tolerate only 3.3 V; WS2812 data generally accepts the 3.3 V level as a high threshold, but in case of a finicky strip, a 3.3 V → 5 V level shifter on the data line is the clean solution.
Procedure (OctoWS2811)
- Install the library via the Library Manager or https://www.pjrc.com/teensy/td_libs_OctoWS2811.html.
- Declare
OctoWS2811 leds(ledsPerStrip, displayType, octoPins)with your parallel pins. leds.beginthen draw withleds.setPixel(index, color)andleds.update— a single DMA update refreshes all strips.- For the complete video example (1920 LEDs), follow the OctoWS2811 page on PJRC.
Procedure (SmartMatrix)
- Mount the SmartLED Shield v4/v5, set the panel resolution in SM_config.h (the 4.1 accepts up to 128x64).
- GIF animation examples and FastLED compatibility provided by the library.
Expected Verification
Entire strips animate at 30 Hz or more without glitches while Serial and your sensors keep running: this is the signature of DMA transfers. The die temperature remains reasonable (see the memory tutorial to monitor it).
Common Errors
- LED power taken from the Teensy's 3.3 V: output reserved for the onboard regulator, 250 mA max — an LED wall is powered by external 5 V, with grounds connected.
- Forgetting the series resistor (~330 Ω) on the data line and the capacitor on the first strip's power supply.
- Confusing the three libraries: OctoWS2811 = synchronous parallel pins; WS2812Serial = DMA serial ports; SmartMatrix = HUB75 panels.
- Following old JTAG wiring: JTAG pins moved in June 2022 on the 4.1 — check your board's date before following an old guide.
Other tutorials for this board
- Premiers pas sur le Teensy 4.1 : Teensyduino, Teensy Loader et premier Blink
- GPIO et PWM sur le Teensy 4.1 : 55 broches en 3,3 V, ni 5 V tolérées ni traîne
- Entrées analogiques du Teensy 4.1 : 18 broches, 2 ADC, 0-3,3 V fixes et zéro DAC
- Logger sur carte SD via le port SDIO natif du Teensy 4.1
- Serveur web embarqué : l'Ethernet natif 10/100 du Teensy 4.1 (DP83825)
- Boîte à rythmes USB MIDI : classes MIDI, MIDIx16 et port hôte USBHost_t36
Code examples for this board
clignotante.inoArduinotouche-capacitive.inoArduinoanalogique-12-bits.inoArduinomidi-piano.inoArduinopwm-respiration.inoArduinoservo-angle.inoArduino