from machine import Pin
from time import sleep
led = Pin(0, Pin.OUT)
while True:
led.value(not led.value())
sleep(0.5)
Using GPIO-0 because (onboard) LED does not work
from machine import Pin
from time import sleep
led = Pin(0, Pin.OUT)
while True:
led.value(not led.value())
sleep(0.5)