fixed indent

This commit is contained in:
Boyan 2022-07-20 19:18:34 +03:00
parent d11ed4f57a
commit 9c2eb6379b

18
main.py
View File

@ -21,19 +21,11 @@ async def button_press(gpio:int, level) -> bool:
asyncio.sleep(.5) asyncio.sleep(.5)
async def ptt(): async def ptt():
if PTT_IS_ON == 1: while True:
print("HEEEEEE") if PTT_IS_ON == 1:
print("HEEEEEE")
if __name__ == "__main__": if __name__ == "__main__":
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
task = loop.create_task(button_press(10, pigpio.EITHER_EDGE)) tasks = asyncio.gather(button_press(10, pigpio.EITHER_EDGE), ptt())
task2 = loop.create.task(ptt()) asyncio.get_event_loop().run_until_complete(tasks)
try:
loop.run_until_complete(task2)
loop.run_until_complete(task)
except asyncio.CancelledError:
pass
while True:
if PTT_IS_ON == 1:
print("WE'RE LIVE")