import machine
import uasyncio as asyncio
async def blink(led, period_ms):
print('blink',period_ms)
while True:
led.on()
print('on')
await asyncio.sleep_ms(1000)
led.off()
print('off')
await asyncio.sleep_ms(period_ms)
async def main(led1, led2):
print('main begin')
asyncio.create_task(blink(led1, 700))
asyncio.create_task(blink(led2, 400))
await asyncio.sleep_ms(20_00)
while True:
await asyncio.sleep_ms(1000)
led1 = machine.Pin(15,machine.Pin.OUT)
led2 = machine.Pin(4,machine.Pin.OUT)
print('here')
asyncio.run(main(led1, led2))
print('game over')