This commit is contained in:
bton 2024-04-12 19:57:14 +02:00
parent 0c238ebd0c
commit 13fb38fc09

View file

@ -10,9 +10,9 @@ serial = i2c(port=1, address=0x3C)
device = ssd1306(serial)
#fonts
name_font=("Purisa", 20, "bold")
name_font=ImageFont.truetype("Purisa", 20, "bold")
name_position=(50,0)
user_id_font=("Purisa", 20, "bold")
user_id_font=ImageFont.truetype("Purisa", 20, "bold")
user_id_position=(30,0)
def balance(user_name, balance):
@ -21,6 +21,6 @@ def balance(user_name, balance):
with canvas(device) as draw:
#draw.rectangle(device.bounding_box, outline="white", fill="black")
draw.create_text(user_id_position, "1", fill="white", font=(user_id_font))
draw.create_text(name_position, "Test", fill="white", font=(name_font))
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)