works reliably - especially when using gunicorn
This commit is contained in:
parent
c937450f92
commit
39cd98823a
7 changed files with 253 additions and 38 deletions
|
|
@ -3,21 +3,21 @@
|
|||
import io
|
||||
from time import sleep
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
#from lib import display
|
||||
import lib.display
|
||||
|
||||
def start(stop_event, text="Hello World!"):
|
||||
t = 0
|
||||
#t = 0
|
||||
image_buffer = lib.display.matrix.buffer()
|
||||
draw = ImageDraw.Draw(image_buffer)
|
||||
draw.rectangle( ((0,0),(lib.display.matrix.width-1,lib.display.matrix.height-1)), fill=(0,0,90) )
|
||||
draw.text((0, 0), "Hello World", fill=(255, 255, 255), font=lib.display.matrix.font)
|
||||
#draw.text((0, 0), f"Hello World {t}", fill=(255, 255, 255), font=lib.display.matrix.font)
|
||||
|
||||
#t += 1
|
||||
#print(t)
|
||||
|
||||
lib.display.matrix.show(image_buffer)
|
||||
while not stop_event.is_set():
|
||||
#image_buffer = Image.new("RGB", (lib.display.matrix_width, lib.display.matrix_height))
|
||||
image_buffer = lib.display.matrix.buffer()
|
||||
draw = ImageDraw.Draw(image_buffer)
|
||||
draw.text((0, 0), f"Hello World {t}", fill=(255, 255, 255), font=lib.display.matrix.font)
|
||||
|
||||
t += 1
|
||||
print(t)
|
||||
|
||||
lib.display.matrix.show(image_buffer)
|
||||
|
||||
#sleep(0.2)
|
||||
sleep(1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue