stuff
This commit is contained in:
parent
0c2152fd86
commit
7a90eb6700
1 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,13 @@ def button_test(*args):
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.create_task(disp.write(2, args))
|
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():
|
async def main():
|
||||||
pi = asyncpio.pi()
|
pi = asyncpio.pi()
|
||||||
dec = decoder(pi, 27, 17, wheel_handler)
|
dec = decoder(pi, 27, 17, wheel_handler)
|
||||||
|
|
@ -29,4 +36,5 @@ if __name__ == "__main__":
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
loop.create_task(main())
|
loop.create_task(main())
|
||||||
|
loop.create_task(tcpu_monitor())
|
||||||
loop.run_forever()
|
loop.run_forever()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue