Hi. I’ve just got a pi 4 with the gfx hat.
I’ve installed the gfx hat as per the installation instructions.
I’ve copied the “hello world” example into a python file named “Display.py”, but when I run it, I get the following errors; and I wondered if anyone could help?
pi@buttons:~ $ python3 Display.py
hello-world.py
This basic example prints the text “Hello World” in the middle of the LCD
Press any button to see its corresponding LED toggle on/off.
Press Ctrl+C to exit.
/home/pi/Display.py:27: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead.
w, h = font.getsize(text)
Traceback (most recent call last):
File “/home/pi/Display.py”, line 51, in
touch.on(x, handler)
File “/usr/local/lib/python3.9/dist-packages/gfxhat/touch.py”, line 119, in on
register(handler)
File “/usr/local/lib/python3.9/dist-packages/gfxhat/touch.py”, line 114, in register
_cap1166.on(channel=button, event=‘press’, handler=handler)
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 386, in on
self.start_watching()
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 400, in start_watching
self.async_poll.start()
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 208, in start
if self.isAlive() == False:
AttributeError: ‘AsyncWorker’ object has no attribute ‘isAlive’
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 409, in stop_watching
self.async_poll.stop()
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 213, in stop
if self.isAlive() == True:
AttributeError: ‘AsyncWorker’ object has no attribute ‘isAlive’
Exception ignored in: <function Cap1xxx.del at 0x7fb832e550>
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 522, in del
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 409, in stop_watching
File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 213, in stop
AttributeError: ‘AsyncWorker’ object has no attribute ‘isAlive’
pi@buttons:~ $