This commit is contained in:
Benjamin Tayehanpour 2026-10-01 19:49:03 +00:00
parent 0c2152fd86
commit 7a90eb6700

View file

@ -14,6 +14,13 @@ def button_test(*args):
loop = asyncio.get_event_loop()
loop.create_task(disp.write(2, args))
async def tcpu_monitor():
loop = asyncio.get_event_loop()
while True:
with open("/sys/class/thermal/thermal_zone0/temp") as temp:
loop.create_task(disp.write(2, f"{int(temp.read())/1000:4.1f}°C"))
await asyncio.sleep(1)
async def main():
pi = asyncpio.pi()
dec = decoder(pi, 27, 17, wheel_handler)
@ -29,4 +36,5 @@ if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.create_task(main())
loop.create_task(tcpu_monitor())
loop.run_forever()