adafruit/Adafruit_CircuitPython_RGB_Display

rgb.py ValueError

craigerl opened this issue · 2 comments

Following instructions at,
https://learn.adafruit.com/adafruit-1-3-and-1-54-240-x-240-wide-angle-tft-lcd-displays/python-wiring-and-setup

Resulted in,

Traceback (most recent call last):
File "/home/pi/./direwatch.py", line 305, in
disp.image(image)
File "/usr/local/lib/python3.11/dist-packages/adafruit_rgb_display/rgb.py", line 230, in image
pix = color565(img.getpixel((i, j)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/adafruit_rgb_display/rgb.py", line 58, in color565
red, g, b = r
^^^^^^^^^
ValueError: too many values to unpack (expected 3)

Raspberry Pi OS Bookworm/12

curiously,
-craig

It looks like this code is avoided if numpy is installed. If we install numpy, it's fine.

sudo apt-get install python3-numpy

That's probably how it got overlooked.