from machine import Pin
from time import sleep
Set up onboard LED (GPIO 25) as output
led = Pin(25, Pin.OUT)
# Infinite loop to blink the LED
while True:
led.value(1) # Turn ON LED
sleep(1) # Wait 1 second
led.value(0) # Turn OFF LED
sleep(1) # Wait 1 second