Python Forum
python script for gfx hat (LCD for raspberry)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python script for gfx hat (LCD for raspberry)
#4
(Jun-30-2019, 08:53 PM)metulburr Wrote: thats a very specific module. I would contact the authors of that module https://github.com/pimoroni/gfx-hat/issues
Hy
Thank you to answer me .
I have sent email.i'm waiting an answer from Author.

(Jun-30-2019, 10:36 PM)noisefloor Wrote: Hi, @domoticity : and the question is...? You describe what you intend to do - and that's it. I mean it's fine, but if you expect an answer, you may want to raise a question to answer. General comments: In case you do not understand the code -> learn Python and read the docs for the Python module driving the display. It won't help you at all if I would try to explain the code to you if you have no basic understanding of Python, its object orientation, classes and methods. Displaying stuff is independent of that. To run scripts at boot time, you need to write systemd Service Units to start you scripts. Do you ever have heard of that? Otherwise, you need to dive into this topic as well. Depending on when the hardware drive is loaded by the Linux kernel, your plan may work or not, as it may be that the network is up and running before the driver for the display is even loaded. Or the driver is loaded first but the network is up 0.5 seconds or so later, so you hardly will see the text displayed before. Anyway, systemd has tools to analyze what is run at which point in the booting process. Regards, noisefloor


Hy,
Thank you to answer me :)

I am learning, trying, reading a lot about Python,
and i have succeeded to display text on my LCD.

And sorry, i have forgotten to post my questions :)

But now, i try to display little picture.

I documented myself here :

http://docs.pimoroni.com/gfxhat/
pil

And here my python script :

#!/usr/bin/env python
import time
from gfxhat import lcd, backlight, fonts
from PIL import Image, ImageFont, ImageDraw

print("""Image boot""")

backlight.set_all(240,240,240)
backlight.show()

lcd.clear()

image = Image.open("/home/test.jpg")
Image.show()

x = 00 
y = 00

lcd.set_pixel(x, y, 1)

lcd.show()
My LCD lights but no picture.

My OS is Debian with no desktop, more precise Raspbian lite.

My question are :
-Can we display pictures in a LCD on gpio without graphical environment ?
I probably did a big mistake in my script bu don't see where :)
Reply


Messages In This Thread
RE: python script for gfx hat (LCD for raspberry) - by domoticity - Jul-02-2019, 09:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Re-write BASH script to Python script popi75 5 2,531 Apr-30-2021, 03:52 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020