This commit is contained in:
bton 2024-04-12 18:38:43 +02:00
parent c9614703c4
commit b1d8fe5ae6

View file

@ -11,7 +11,9 @@ device = ssd1306(serial)
#fonts
name_font=("Purisa", 20, "bold")
name_position=(50,0)
user_id_font=("Purisa", 20, "bold")
user_id_position(30,0)
def balance(user_name, balance):
with canvas(device) as draw:
@ -19,6 +21,6 @@ def balance(user_name, balance):
with canvas(device) as draw:
#draw.rectangle(device.bounding_box, outline="white", fill="black")
draw.text((30, 0, 50), "Hello World", fill="white")
draw.text((80, 0, 50), "Test", fill="white")
draw.text(user_id_position, "1", fill="white", font=user_id_font)
draw.text(name_position, "Test", fill="white", font=name_font)
time.sleep(10)