# Import necessary modules
# Pin is used to control the GPIO pins of the Raspberry Pi Pico
# sleep is used to create a delay between turning the LED on and off from machine import Pin
from time import sleep
# Define the LED pin
# GPIO 15 (physical pin 20) is set as an output pin to control the LED ledred = Pin(2, Pin.OUT)
# Start an infinite loop to blink the LED continuously
while True:
ledred.value(1) # Set GPIO 15 to high (turn the LED on) sleep(1)
# Wait for 1 second with the LED on
ledred.value(0) # Set GPIO 15 to low (turn the LED off) sleep(1)