From 5bf3ecb5457b87f34101a155b905724c83b04751 Mon Sep 17 00:00:00 2001 From: bton Date: Wed, 17 Apr 2024 20:01:14 +0200 Subject: [PATCH] test --- NFC_Reader.py | 12 ++++++------ oled.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NFC_Reader.py b/NFC_Reader.py index 339f9d2..f27e1c4 100644 --- a/NFC_Reader.py +++ b/NFC_Reader.py @@ -19,12 +19,12 @@ def get_reader(): def onTagSense(tag): id = int.from_bytes(tag.identifier, "big") response = requests.post(f"{url}tag_id", data={"id":id}) - try: - if response.json()["mode"] == "balance" or response.json()["mode"] == "message": - subprocess.run(oled.balance(response.json()["user"], responese.json()["balance"])) - return True - except: - None + #try: + if response.json()["mode"] == "balance" or response.json()["mode"] == "message": + subprocess.run(oled.balance(response.json()["user"], responese.json()["balance"])) + return True + #except: + # None return False def start_nfc_normal(): diff --git a/oled.py b/oled.py index 07b5c5e..5c6ac02 100644 --- a/oled.py +++ b/oled.py @@ -10,13 +10,13 @@ def clear(): display.fill(0) display.show() -async def balance(user_name, balance): - await clear() +def balance(user_name, balance): + clear() display.text(str(user_name), 50, 0, (255,255,255), size=1) display.text(str(balance), 0, 15, (255,255,255), size=2) display.show() - await time.sleep(5) - await clear() + time.sleep(5) + clear() def error(code): clear()