test
This commit is contained in:
parent
75109235c2
commit
c9614703c4
1 changed files with 4 additions and 4 deletions
8
oled.py
8
oled.py
|
@ -7,12 +7,11 @@ from pathlib import Path
|
||||||
import time
|
import time
|
||||||
|
|
||||||
serial = i2c(port=1, address=0x3C)
|
serial = i2c(port=1, address=0x3C)
|
||||||
|
|
||||||
device = ssd1306(serial)
|
device = ssd1306(serial)
|
||||||
|
|
||||||
def make_font(name, size):
|
#fonts
|
||||||
font_path = str(Path(__file__).resolve().parent.joinpath('fonts', name))
|
name_font=("Purisa", 20, "bold")
|
||||||
return ImageFont.truetype(font_path, size)
|
|
||||||
|
|
||||||
def balance(user_name, balance):
|
def balance(user_name, balance):
|
||||||
with canvas(device) as draw:
|
with canvas(device) as draw:
|
||||||
|
@ -21,4 +20,5 @@ 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((30, 0, 50), "Hello World", fill="white")
|
||||||
|
draw.text((80, 0, 50), "Test", fill="white")
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
Loading…
Reference in a new issue