fixed indent
This commit is contained in:
parent
956672e499
commit
d11ed4f57a
14
main.py
14
main.py
@ -20,8 +20,20 @@ async def button_press(gpio:int, level) -> bool:
|
||||
PTT_IS_ON = 0
|
||||
asyncio.sleep(.5)
|
||||
|
||||
async def ptt():
|
||||
if PTT_IS_ON == 1:
|
||||
print("HEEEEEE")
|
||||
|
||||
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:
|
||||
if PTT_IS_ON == 1:
|
||||
print("WE'RE LIVE")
|
||||
|
Loading…
x
Reference in New Issue
Block a user