test
This commit is contained in:
parent
515a6a5c38
commit
39d51595f9
1 changed files with 7 additions and 1 deletions
8
oled.py
8
oled.py
|
@ -10,10 +10,16 @@ def clear():
|
|||
display.show()
|
||||
|
||||
def Balance(user_id, user_name, balance):
|
||||
if balance < 10:
|
||||
position_x = 50
|
||||
elif balance >= 10 and balance < 100:
|
||||
position_x = 30
|
||||
elif balance >= 100 and balance < 1000:
|
||||
position_x = 10
|
||||
clear()
|
||||
display.text(str(user_id), 0, 0, (255,255,255), size=1)
|
||||
display.text(str(user_name), 50, 0, (255,255,255), size=1)
|
||||
display.text(str(balance), 0, 10, (255,255,255), size=2)
|
||||
display.text(str(balance), 0, position_x, (255,255,255), size=2)
|
||||
display.show()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue