Here is my code:
Code: Select all
import uasyncio as asyncio
async def blink1():
bled=LED(4)
while True:
bled.toggle()
await asyncio.sleep_ms(1000)
async def blink2():
gled = LED(2)
while True:
gled.toggle()
await asyncio.sleep_ms(2000)
loop = asyncio.get_event_loop()
loop.create_task(blink1())
loop.create_task(blink2())
loop.run_forever()