I am trying to hook up an 8x8 LED matrix to my Raspberry Pi 4B. I connected it to SPI1 because I am already using SPI0 for another device. Here are the pins I am using:
CLK - GPIO 20 CS - GPIO 16 DIN - GPIO 18
According to my readings, this means the device can be controlled through spi port 1 device 2. The issue that I have is that 50% of the LEDs are permanently on. Here is a picture of what it looks like.
I tried to clear the device using the code below but nothing happens. When I try to display something, only the LEDs that are not permanently on turn on. Any idea on what I am doing wrong?
from luma.led_matrix.device import max7219 from luma.core.interface.serial import spi, noop from luma.core.render import canvas from luma.core.virtual import viewport from luma.core.legacy import text, show_message from luma.core.legacy.font import proportional, CP437_FONT, TINY_FONT, SINCLAIR_FONT, LCD_FONT serial = spi(port=1, device=2, gpio=noop()) device = max7219(serial, width=8, height=8, block_orientation=-90) device.hide()