Jul-04-2019, 09:47 AM
(This post was last modified: Jul-04-2019, 09:48 AM by domoticity.)
(Jul-04-2019, 02:09 AM)noisefloor Wrote: Hi, it doesn't work because you ignored what I wrote about and / or don't understand the code you posted in the initial post. Again: you have to iterate over the image and need to set _each_ pixel of your LCD, one-by-one. That's what the lines 59-62 do in the code of your 1st post. The Python module for display seems to have no high-level interface, you have to deal low level which each pixel. Regards, noisefloor
Hy
thank you to answer.
I don't ignore what you wrote.
Ii don't understand the whole code in the initial post.
I try to find informations about to better understand.
I try to modify considering what you have wrote
#!/usr/bin/env python import time from gfxhat import lcd, backlight, fonts from PIL import Image, ImageFont, ImageDraw print("""Message de demarrage""") backlight.set_all(240,240,240) backlight.show() lcd.clear() width, height = lcd.dimensions() image = Image.open("/tmp/aa.jpg") draw = ImageDraw.Draw(image) for x in range(50): for y in range(50): pixel = image.getpixel((x, y)) lcd.set_pixel(x, y, pixel) lcd.show()The error whicvh i have when i execut the scripts :
root@diagbox:/tmp# python test.py
Message de demarrage
Traceback (most recent call last):
File "test.py", line 21, in <module>
lcd.set_pixel(x, y, pixel)
File "/usr/local/lib/python2.7/dist-packages/gfxhat/st7567.py", line 137, in set_pixel
self.buf[offset] |= (value & 1) << bit
TypeError: unsupported operand type(s) for &: 'tuple' and 'int'