From 13fb38fc092ae883ae7606cf1d8262bf9f1e1ee5 Mon Sep 17 00:00:00 2001 From: bton Date: Fri, 12 Apr 2024 19:57:14 +0200 Subject: [PATCH] test --- oled.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oled.py b/oled.py index 513e0d2..7c043a1 100644 --- a/oled.py +++ b/oled.py @@ -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)