stuff
This commit is contained in:
parent
b0b4012973
commit
6e3bb75aeb
4 changed files with 47 additions and 8 deletions
|
|
@ -1,4 +1,26 @@
|
|||
import asyncio
|
||||
from button import button
|
||||
from decoder import decoder
|
||||
from display import display
|
||||
|
||||
async def wheel_handler(dir):
|
||||
print(f"wheel: {dir}")
|
||||
|
||||
async def button_test(**args):
|
||||
print(args)
|
||||
|
||||
async def main():
|
||||
pi = asyncpio.pi()
|
||||
dec = decoder(pi, 27, 17, wheel_handler)
|
||||
b1 = button(pi, 23, button_test)
|
||||
b2 = button(pi, 24, button_test)
|
||||
await pi.connect()
|
||||
await dec.start()
|
||||
await b1.start()
|
||||
await b2.start()
|
||||
|
||||
if __name__ == "__main__":
|
||||
disp = display()
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.create_task(main())
|
||||
loop.run_forever()
|
||||
Loading…
Add table
Add a link
Reference in a new issue