Compare commits
No commits in common. "f223be9209793524747452d84f761770e1c7b531" and "80219414c713906218b925c10ec1e1887700f57d" have entirely different histories.
f223be9209
...
80219414c7
2 changed files with 3 additions and 8 deletions
|
@ -2,8 +2,8 @@ import time
|
||||||
import nfc
|
import nfc
|
||||||
import subprocess
|
import subprocess
|
||||||
import requests
|
import requests
|
||||||
|
import asyncio
|
||||||
import oled
|
import oled
|
||||||
import subprocess
|
|
||||||
|
|
||||||
url="http://172.16.1.105/api/"
|
url="http://172.16.1.105/api/"
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ def onTagSense(tag):
|
||||||
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"]))
|
#oled.Balance(response.json()["username"], response.json()["balance"])
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
None
|
None
|
||||||
|
|
7
oled.py
7
oled.py
|
@ -10,7 +10,7 @@ def clear():
|
||||||
display.fill(0)
|
display.fill(0)
|
||||||
display.show()
|
display.show()
|
||||||
|
|
||||||
async def balance(user_name, balance):
|
async def Balance(user_name, balance):
|
||||||
await clear()
|
await 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)
|
||||||
|
@ -18,10 +18,5 @@ async def balance(user_name, balance):
|
||||||
await time.sleep(5)
|
await time.sleep(5)
|
||||||
await clear()
|
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__":
|
if __name__ == "__main__":
|
||||||
Balance("Test", -255555)
|
Balance("Test", -255555)
|
||||||
|
|
Loading…
Reference in a new issue