This commit is contained in:
bton 2024-04-17 20:01:14 +02:00
parent f223be9209
commit 5bf3ecb545
2 changed files with 10 additions and 10 deletions

View file

@ -19,12 +19,12 @@ def get_reader():
def onTagSense(tag): def onTagSense(tag):
id = int.from_bytes(tag.identifier, "big") id = int.from_bytes(tag.identifier, "big")
response = requests.post(f"{url}tag_id", data={"id":id}) response = requests.post(f"{url}tag_id", data={"id":id})
try: #try:
if response.json()["mode"] == "balance" or response.json()["mode"] == "message": if response.json()["mode"] == "balance" or response.json()["mode"] == "message":
subprocess.run(oled.balance(response.json()["user"], responese.json()["balance"])) subprocess.run(oled.balance(response.json()["user"], responese.json()["balance"]))
return True return True
except: #except:
None # None
return False return False
def start_nfc_normal(): def start_nfc_normal():

View file

@ -10,13 +10,13 @@ def clear():
display.fill(0) display.fill(0)
display.show() display.show()
async def balance(user_name, balance): def balance(user_name, balance):
await clear() clear()
display.text(str(user_name), 50, 0, (255,255,255), size=1) display.text(str(user_name), 50, 0, (255,255,255), size=1)
display.text(str(balance), 0, 15, (255,255,255), size=2) display.text(str(balance), 0, 15, (255,255,255), size=2)
display.show() display.show()
await time.sleep(5) time.sleep(5)
await clear() clear()
def error(code): def error(code):
clear() clear()