🐦 Tutorial 28 - 8x8 LED Matrix

The 8x8 LED Matrix module is a display device that consists of 64 individual LED lights arranged in an 8x8 grid. It is commonly used in electronic projects for displaying letters, numbers, symbols, and graphics.

The LED matrix is controlled by a microcontroller or other device using a multiplexing technique, which allows for individual control of each LED by switching them on and off at a high frequency. This technique enables the display of complex patterns and animations using a relatively small number of pins.

The 8x8 LED Matrix module typically uses a MAX7219 or MAX7221 driver IC, which simplifies the control of the display and reduces the number of pins required to interface with the microcontroller. The driver IC also provides additional features such as brightness control and scanning modes.

The LED Matrix module can be programmed using a variety of programming languages, including C, C++, Python, and others, making it a versatile and popular choice for hobbyists and professionals alike.

Overall, the 8x8 LED Matrix module is a simple and effective display device that can be used for a wide range of electronic projects, from displaying text and simple animations to creating more complex graphical displays. Its versatility and ease of use make it a popular choice for makers and electronics enthusiasts.

Components Needed

ComponentQuantity
Raspberry Pi Pico W1
Micro USB Cable1
Breadboard1
WiresSeveral
Resistor1
8x8 LED Matrix1
74HC5951

Fritzing Diagram

Code

import machine
import time

sdi = machine.Pin(18,machine.Pin.OUT)
rclk = machine.Pin(19,machine.Pin.OUT)
srclk = machine.Pin(20,machine.Pin.OUT)


glyph = [0xFF,0xBB,0xD7,0xEF,0xD7,0xBB,0xFF,0xFF]

# Shift the data to 74HC595
def hc595_in(dat):
    for bit in range(7,-1, -1):
        srclk.low()
        time.sleep_us(30)
        sdi.value(1 & (dat >> bit))
        time.sleep_us(30)
        srclk.high()

def hc595_out():
    rclk.high()
    time.sleep_us(200)
    rclk.low()

while True:
    for i in range(0,8):
        hc595_in(glyph[i])
        hc595_in(0x80>>i)
        hc595_out()

Code Explanation