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)
|
asyncio.sleep(.5)
|
||||||
|
|
||||||
async def ptt():
|
async def ptt():
|
||||||
|
while True:
|
||||||
if PTT_IS_ON == 1:
|
if PTT_IS_ON == 1:
|
||||||
print("HEEEEEE")
|
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")
|
|
Loading…
x
Reference in New Issue
Block a user