from machine import Pin
import utime
# Define the onboard LED pin
led_pin = Pin(25, Pin.OUT)
# Function to control the LED
def control_led():
led_pin.value(1) # Turn on the LED
utime.sleep(2) # Wait for 2 seconds
led_pin.value(0) # Turn off the LED
utime.sleep(1) # Wait for 1 second
# Main loop
while True:
control_led()