fixed indent
This commit is contained in:
parent
d11ed4f57a
commit
9c2eb6379b
14
main.py
14
main.py
@ -21,19 +21,11 @@ async def button_press(gpio:int, level) -> bool:
|
||||
asyncio.sleep(.5)
|
||||
|
||||
async def ptt():
|
||||
while True:
|
||||
if PTT_IS_ON == 1:
|
||||
print("HEEEEEE")
|
||||
|
||||
if __name__ == "__main__":
|
||||
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:
|
||||
if PTT_IS_ON == 1:
|
||||
print("WE'RE LIVE")
|
||||
tasks = asyncio.gather(button_press(10, pigpio.EITHER_EDGE), ptt())
|
||||
asyncio.get_event_loop().run_until_complete(tasks)
|
Loading…
x
Reference in New Issue
Block a user