fixed indent

This commit is contained in:
Boyan 2022-07-20 17:53:14 +03:00
parent 956672e499
commit d11ed4f57a

14
main.py
View File

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