test
This commit is contained in:
parent
0c238ebd0c
commit
13fb38fc09
1 changed files with 4 additions and 4 deletions
8
oled.py
8
oled.py
|
@ -10,9 +10,9 @@ serial = i2c(port=1, address=0x3C)
|
||||||
device = ssd1306(serial)
|
device = ssd1306(serial)
|
||||||
|
|
||||||
#fonts
|
#fonts
|
||||||
name_font=("Purisa", 20, "bold")
|
name_font=ImageFont.truetype("Purisa", 20, "bold")
|
||||||
name_position=(50,0)
|
name_position=(50,0)
|
||||||
user_id_font=("Purisa", 20, "bold")
|
user_id_font=ImageFont.truetype("Purisa", 20, "bold")
|
||||||
user_id_position=(30,0)
|
user_id_position=(30,0)
|
||||||
|
|
||||||
def balance(user_name, balance):
|
def balance(user_name, balance):
|
||||||
|
@ -21,6 +21,6 @@ def balance(user_name, balance):
|
||||||
|
|
||||||
with canvas(device) as draw:
|
with canvas(device) as draw:
|
||||||
#draw.rectangle(device.bounding_box, outline="white", fill="black")
|
#draw.rectangle(device.bounding_box, outline="white", fill="black")
|
||||||
draw.create_text(user_id_position, "1", fill="white", font=(user_id_font))
|
draw.text(user_id_position, "1", fill="white", font=(user_id_font))
|
||||||
draw.create_text(name_position, "Test", fill="white", font=(name_font))
|
draw.text(name_position, "Test", fill="white", font=(name_font))
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
Loading…
Reference in a new issue