test
This commit is contained in:
parent
c9614703c4
commit
b1d8fe5ae6
1 changed files with 5 additions and 3 deletions
8
oled.py
8
oled.py
|
@ -11,7 +11,9 @@ device = ssd1306(serial)
|
||||||
|
|
||||||
#fonts
|
#fonts
|
||||||
name_font=("Purisa", 20, "bold")
|
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):
|
def balance(user_name, balance):
|
||||||
with canvas(device) as draw:
|
with canvas(device) as draw:
|
||||||
|
@ -19,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.text((30, 0, 50), "Hello World", fill="white")
|
draw.text(user_id_position, "1", fill="white", font=user_id_font)
|
||||||
draw.text((80, 0, 50), "Test", fill="white")
|
draw.text(name_position, "Test", fill="white", font=name_font)
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
Loading…
Reference in a new issue