0

I got a 32x32 RGB LED matrix for Christmas, and i plugged it into my adafruit RGB matrix HAT + RTC. I found a website: https://learn.adafruit.com/adafruit-rgb-matrix-plus-real-time-clock-hat-for-raspberry-pi/driving-matrices and copied the code across onto python 2, and when I run the code, nothing happens. The display definitely works, because I typed in the code from the website into the terminal, and the pre-made codes work fine, but the python code doesn't. Please can someone help me by telling me the right code? The code i used was:

import time
from rgbmatrix import Adafruit_RGBmatrix

print("1st")

matrix = Adafruit_RGBmatrix(32, 1)

print("2nd")

matrix.Fill(0xFF0000)
time.sleep(1.0)
matrix.Fill(0x00FF00)
time.sleep(1.0)
matrix.Fill(0x0000FF)
time.sleep(1.0)

print("3rd")

for b in range(16):
        for g in range(8):
                for r in range(8):
                        matrix.SetPixel(
                          (b / 4) * 8 + g,
                          (b & 3) * 8 + r,
                          (r * 0b001001001) / 2,
                          (g * 0b001001001) / 2,
                           b * 0b00010001)
print("4th")
time.sleep(10.0)
matrix.Clear()

i put in the print commands, but only "1st" printed

Andrew Bell
  • 23
  • 2
  • 7

0 Answers0