Zum Hauptinhalt springen Zur Suche springen Zur Hauptnavigation springen

LED Matrix 4x 8x8 Pixel weiss MAX7219 Kontroller

Produktinformationen "LED Matrix 4x 8x8 Pixel weiss MAX7219 Kontroller"

LED Matrix 4x 8x8Pixel weiss MAX7219 Kontroller

Leistungsdaten: 
Modell: LED-DotMatrix RGB
Hersteller: verschiedene
Typ: Elektronik
Format: 4 Kaskadierbare Segmente à 8x8
Aufbau: 4 Anzeigen à 8x8 LEDs 
Farbe: rote LEDs
Versorgungsspannung: 5.0V
Leistung: 0-10W für 4 Module (Max 2.0Amp mit 5.0V) 
Schutz: IP20 offen
Helligkeit: 15-Stufen (PWM 1/15tel bis 15/15tel)
Anschluss: Seriell: D-IN, CLK, CS, +5V, GND
Kontroller: MAX7219
Schnittstelle: Seriell: D-IN, CLK, CS
Chip: LED 8x8
Betriebsspannung: 5.0V DC
Stromaufnahme: 0-2.5W pro 8x8er Einheit, total 0-10W
Abmessungen: 12.8x12.8x1.3cm pro 8x8 Einheit


# ESP32 Python Demo Code
import machine, time
import array as arr
# MAX7219 Anschluss (Demo-Programm)
# ESP32 Pin VIN <-> MAX7219 VCC
# ESP32 Pin GND <-> MAX7219 GND
# ESP32 Pin-12 D12 <-> MAX7219 DIN
# ESP32 Pin-14 D14 <-> MAX7219 /CS (Pos Flanke Latch Data)
# ESP32 Pin-27 D27 <-> MAX7219 CLK (Pos Flanke catch Data)

# Inizialisieren Pins für SPI, Buffer, Konfigregister im Buffer
def MAX7219_init(DataPinNo, CSPinNo, CLKPinNo, MAX7219Count):
    global MAX7219DATA
    global MAX7219CS
    global MAX7219CLK
    MAX7219DATA = machine.Pin(12, machine.Pin.OUT) # MAX7219-DAta
    MAX7219CS = machine.Pin(14, machine.Pin.OUT) # MAX7219-CS
    MAX7219CLK = machine.Pin(27, machine.Pin.OUT) # MAX7219-CLK
    MAX7219DATA.off() # SPI Data Bit ausschalten
    MAX7219CS.off() # SPI CS Bit ausschalten
    MAX7219CLK.off() # SPI CLK Bit ausschalten
    global MAX7219BUFF # Buffer Array mit Daten aller MAX7219
    MAX7219BUFF = [[0 for _ in range(16)] for _ in range(MAX7219Count) ] # 2D Array mit 0 gefüllt
    # Config Register laden
    MAX7219BUFF[0][0x09] = 0x00 # Adress 00
    MAX7219BUFF[0][0x0A] = 0x00 # Idensity 00-15 0=Minimum 1/16tel
    MAX7219BUFF[0][0x0B] = 0x07 # Scan-Limit Register 0-7 Spalten
    MAX7219BUFF[0][0x0C] = 0x01 # ShutDown Register = Normal Operation
    MAX7219BUFF[0][0x0F] = 0x00 # Display-Test Register Format = Normal Mode
    for i in range(0,16): # Copy Config Register von Modul 0 auf alle weiteren Module
          for ii in range(1,MAX7219Count):
              MAX7219BUFF[ii][i] = MAX7219BUFF[0][i]

def MAX7219ShiftByte(data): # Sende ein Byte als Bit für Bit per SPI
    MAX7219CLK.off() # Setze SPI Clock=0 (off)
    for i in range(8):
        value = ((data << i) & 0B10000000) != 0
        MAX7219DATA.value(value) # Setze DIN gem. Bit-Wert
        MAX7219CLK.on() # Steigende Flanke von 0 zu 1
        MAX7219CLK.off() # wieder ausschalten

def MAX7219ModuleWrite(address, data): # Write one address / data (in a register) of the MAX7219.
    MAX7219CS.off() # Setze SPI CS=0 (off)
    MAX7219ShiftByte(address) # Sende 8-Bit Adresse
    MAX7219ShiftByte(data) # Sende 8-Bit Daten

def MAX7219SPIWrite():  # Sende 16 Byte je Modul per SPI
    for i in range(0,16): # Adressregister 0 .. 15
          for ii in range(len(MAX7219BUFF)-1,-1,-1): # Von MAX7219Count nach 0 Step -1
              MAX7219ModuleWrite(i,MAX7219BUFF[ii][i]) # (Register,Daten-Wert)
          MAX7219CS.on() # Steigende Flanke von 0 zu 1, SPI einspeichern
          MAX7219CS.off() # wieder ausschalten

# **** MAIN PROG ****
MAX7219Count = 4 # Anzahl Module zu viele sind auch OK
MAX7219_init(12, 14, 27, MAX7219Count)# MAX7219_init(DataPinNo, CSPinNo, CLKPinNo, MAX7219Count)
MAX7219BUFF[0][0x01] = 0B00100100 # Modul 0, Adresse 01 (1. Zeile)
MAX7219BUFF[0][0x02] = 0B01011010 # Modul 0, Adresse 02 (2. Zeile)
MAX7219BUFF[0][0x03] = 0B10011001 # Modul 0, Adresse 03 (3. Zeile)
MAX7219BUFF[0][0x04] = 0B10000001 # Modul 0, Adresse 04 (4. Zeile)
MAX7219BUFF[0][0x05] = 0B10000001 # Modul 0, Adresse 05 (5. Zeile)
MAX7219BUFF[0][0x06] = 0B01000010 # Modul 0, Adresse 06 (6. Zeile)
MAX7219BUFF[0][0x07] = 0B00100100 # Modul 0, Adresse 07 (7. Zeile)
MAX7219BUFF[0][0x08] = 0B00011000 # Modul 0, Adresse 08 (8. Zeile)
MAX7219BUFF[1][0x08] = 0x18 # Modul 1, Adresse 08 (8. Zeile)
MAX7219BUFF[2][0x08] = 0x24 # Modul 2, Adresse 08 (8. Zeile)
MAX7219BUFF[3][0x08] = 0x42 # Modul 3, Adresse 08 (8. Zeile)
MAX7219SPIWrite() # Sende Buffer via SPI an die MAX7219 der Module

0 von 0 Bewertungen

Durchschnittliche Bewertung von 0 von 5 Sternen

Bewerten Sie dieses Produkt!

Teilen Sie Ihre Erfahrungen mit anderen Kunden.