ASYNC IS FUN

This commit is contained in:
Boyan 2022-07-20 17:37:49 +03:00
parent 880d379dd1
commit c3df43733b

View File

@ -29,7 +29,7 @@ def button_press(gpio:int, level) -> bool:
PTT_IS_ON = 0
if __name__ == "__main__":
asyncio.run(button_press(10, pigpio.EITHER_EDGE))
asyncio.create_task(button_press(10, pigpio.EITHER_EDGE))
while True:
if PTT_IS_ON == 1:
print("WE'RE LIVE")