Programmieren von Adafruit LED‑Matrizen (NeoPixel & HUB75)
Zwei Wege zum leuchtenden Ergebnis: NeoPixel‑NeoMatrix 8×8 für den Einstieg
und RGB HUB75‑Matrix 64×32 für großformatige Anzeigen. Du bekommst Stücklisten (nur SKU),
Verdrahtung, Strom‑Hinweise und lauffähige Arduino‑Beispiele.
Variante A – NeoPixel NeoMatrix 8×8 (einfach & flexibel)
Komponenten (nur SKU)
Kategorie |
Bauteil |
SKU |
Hinweis |
Controller |
Adafruit Feather RP2040 |
4884 |
Preiswert, schnell; alternativ Feather M4 Express 3857. |
LED‑Matrix |
NeoPixel NeoMatrix 8×8 (64 RGB‑Pixel) |
1487 |
Ein Datenpin reicht. |
Strom |
5 V 2 A Schaltnetzteil |
276 |
Ausreichend für 8×8 bei moderater Helligkeit. |
Optional |
5 V 10 A Netzteil (für größere NeoPixel‑Felder) |
658 |
Für mehrere Panels/hohe Helligkeit. |
Zubehör |
330–470 Ω Daten‑Vorwiderstand, 1000 µF Elko (5 V), GND gemeinsam |
— |
Best‑Practice für NeoPixel. |
Verdrahtung
-
Feather → NeoMatrix: GND → GND, 5V → +5V, D5 (oder D6) → DIN über 330–470 Ω.
-
1000 µF Elko zwischen +5 V und GND am Matrix‑Eingang (Polarität beachten).
-
Gemeinsame Masse: Netzteil‑GND, Feather‑GND und Matrix‑GND verbinden.
Arduino‑Beispiel (laufender Text auf 8×8)
// GoMaker × Adafruit — NeoMatrix 8×8 (SKU: 1487) mit Feather RP2040 (SKU: 4884)
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#define PIN 5 // Datenpin zum DIN der NeoMatrix
Adafruit_NeoMatrix matrix(8, 8, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);
const char* msg = "GoMaker";
int x = 8;
void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(20); // 0..255 (mach es nicht zu hell bei 5V/2A)
matrix.fillScreen(0);
}
void loop() {
matrix.fillScreen(0);
matrix.setCursor(x, 7); // y=7 (untere Zeile)
matrix.setTextColor(matrix.Color(0, 150, 255));
matrix.print(msg);
matrix.show();
if (--x < -(int)strlen(msg)*6) { // 6px pro Zeichen (Standardfont)
x = 8;
}
delay(50);
}
Leistung/Power: 64 NeoPixel × max. ~60 mA ≈ 3,8 A bei Weiß‑Vollhelligkeit.
Im Code die Helligkeit begrenzen (z. B. 20–60) oder größere Netzteile nutzen.
Variante B – RGB HUB75‑Matrix 64×32 (hell & groß)
Komponenten (nur SKU)
Kategorie |
Bauteil |
SKU |
Hinweis |
Controller |
Adafruit MatrixPortal M4 |
4745 |
Speziell für HUB75‑Panels, Plug‑and‑Play. |
LED‑Panel |
RGB LED Matrix 64×32 (4 mm Pitch) |
2278 |
HUB75‑Panel; weitere Pitches möglich (z. B. 3 mm 2279, 2.5 mm 5036). |
Strom |
5 V 10 A Schaltnetzteil |
658 |
RGB‑Panels sind stromhungrig; Reserve einplanen. |
Zubehör |
Schraubklemmen/Leitungen für +5 V/GND zum Panel |
— |
GND des Controllers mit Panel‑GND verbinden. |
Verdrahtung (MatrixPortal M4)
- MatrixPortal M4 direkt an den HUB75‑Eingang des Panels stecken (richtige Ausrichtung beachten).
- Panel separat mit +5 V/GND vom Netzteil versorgen; GND mit dem MatrixPortal gemeinsam führen.
- Für 64×32‑Panels genügen meist A,B,C,D Adressleitungen (E nur bei 64×64).
Arduino‑Beispiel (Protomatter: Text‑Scroll 64×32)
// GoMaker × Adafruit — HUB75 64×32 (SKU: 2278) mit MatrixPortal M4 (SKU: 4745)
// Benötigte Libs: Adafruit_Protomatter, Adafruit_GFX
#include <Adafruit_GFX.h>
#include <Adafruit_Protomatter.h>
// Pins passend zum MatrixPortal M4 (64×32, 1/16 Scan)
uint8_t rgbPins[] = {7, 8, 9, 10, 11, 12};
uint8_t addrPins[] = {17, 18, 19, 20}; // A, B, C, D
uint8_t clockPin = 14; // CLK
uint8_t latchPin = 15; // LAT
uint8_t oePin = 16; // OE
Adafruit_Protomatter matrix(
64, 4, 1, rgbPins, 4, addrPins, clockPin, latchPin, oePin, false);
const char* msg = "GoMaker RGB!";
int16_t x;
void setup() {
ProtomatterStatus status = matrix.begin();
if (status != PROTOMATTER_OK) for(;;); // Fehlerfall: stehenbleiben
matrix.setTextWrap(false);
matrix.setTextColor(0xF81F); // Magenta (RGB565)
matrix.setTextSize(1);
x = matrix.width();
}
void loop() {
matrix.fillScreen(0);
matrix.setCursor(x, 24); // y ~ Baseline (unten)
matrix.print(msg);
if (--x < - (int)strlen(msg)*6) x = matrix.width();
matrix.show();
delay(20);
}
Hinweis zu Pitches: Beim 64×32‑Panel mit 2.5 mm Pitch (SKU 5036) sind die
Grün/Blau‑Kanäle getauscht; in Software G1/G2 mit B1/B2 vertauschen.
Strom & Best Practices
-
NeoPixel: 300–500 Ω in Datenleitung, 1000 µF Elko an +5 V/GND, erst GND verbinden, dann +5 V, dann Daten.
-
Helligkeit begrenzen: LED‑Leistung skaliert stark mit Helligkeit; reduziere
setBrightness()
bzw. nutze dunklere Farben.
-
GND gemeinsam: Controller‑, Netzteil‑ und Panel‑Masse verbinden.