# Import necessary modules
# Pin is used to control the GPIO pins of the Raspberry Pi Pico
# sleep is used to create a delay betweeb 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)
ledorange = Pin(3, Pin.OUT)
ledgreen = Pin(4, Pin.OUT)
# Start an infinte loop to blink the LED continously
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)
ledorange.value(1) # Set GPIO 15 to high (turn the LED on)
sleep(1) #Wait for 1 second with the LED on
ledorange.value(0) #Set GPIO 15 to low (turn the LED off)
sleep(1)
ledgreen.value(1) # Set GPIO 15 to high (turn the LED on)
sleep(1) #Wait for 1 second with the LED on
ledgreen.value(0) #Set GPIO 15 to low (turn the LED off)
sleep(1)