Compare commits
2 commits
80219414c7
...
f223be9209
Author | SHA1 | Date | |
---|---|---|---|
f223be9209 | |||
c2d6110576 |
2 changed files with 8 additions and 3 deletions
|
@ -2,8 +2,8 @@ import time
|
|||
import nfc
|
||||
import subprocess
|
||||
import requests
|
||||
import asyncio
|
||||
import oled
|
||||
import subprocess
|
||||
|
||||
url="http://172.16.1.105/api/"
|
||||
|
||||
|
@ -21,7 +21,7 @@ def onTagSense(tag):
|
|||
response = requests.post(f"{url}tag_id", data={"id":id})
|
||||
try:
|
||||
if response.json()["mode"] == "balance" or response.json()["mode"] == "message":
|
||||
#oled.Balance(response.json()["username"], response.json()["balance"])
|
||||
subprocess.run(oled.balance(response.json()["user"], responese.json()["balance"]))
|
||||
return True
|
||||
except:
|
||||
None
|
||||
|
|
7
oled.py
7
oled.py
|
@ -10,7 +10,7 @@ def clear():
|
|||
display.fill(0)
|
||||
display.show()
|
||||
|
||||
async def Balance(user_name, balance):
|
||||
async def balance(user_name, balance):
|
||||
await clear()
|
||||
display.text(str(user_name), 50, 0, (255,255,255), size=1)
|
||||
display.text(str(balance), 0, 15, (255,255,255), size=2)
|
||||
|
@ -18,5 +18,10 @@ async def Balance(user_name, balance):
|
|||
await time.sleep(5)
|
||||
await clear()
|
||||
|
||||
def error(code):
|
||||
clear()
|
||||
display.text("!!!!ERROR!!!!", 50, 0 (255,255,255), size=2)
|
||||
display.text(str(code), 50, 10, (255,255,255), size=2)
|
||||
|
||||
if __name__ == "__main__":
|
||||
Balance("Test", -255555)
|
||||
|
|
Loading…
Reference in a new issue