# main.py
import uasyncio as asyncio
from machine import Pin


async def blink(led: Pin) -> None:
    while True:
        led.on()
        await asyncio.sleep(0.5)
        led.off()
        await asyncio.sleep(0.5)


async def print_test() -> None:
    counter = 0

    while True:
        counter += 1
        print(f"Debug message no. {counter}")
        await asyncio.sleep(0.3)
        # print("Debug after")


async def main() -> None:
    led = Pin(2, Pin.OUT)

    task1 = asyncio.create_task(blink(led))
    print(f"TAsk ? {task1}")

    task2 = asyncio.create_task(print_test())
    print(f"TAsk ? {task2}")

    while True:
        # for _ in range(500):
        await asyncio.sleep(0)

    
asyncio.run(main())