import machine
import time
# Define the pins for the RGB LED
red_pin = machine.Pin(28, machine.Pin.OUT)
green_pin = machine.Pin(27, machine.Pin.OUT)
blue_pin = machine.Pin(26, machine.Pin.OUT)
# Function to set RGB LED color
def set_color(red, green, blue):
    red_pin.value(red)
    green_pin.value(green)
    blue_pin.value(blue)
try:
    while True:
        # Red
        set_color(1, 0, 0)
        time.sleep(1)
        # Green
        set_color(0, 1, 0)
        time.sleep(1)
        # Blue
        set_color(0, 0, 1)
        time.sleep(1)
        # Yellow (Red + Green)
        set_color(1, 1, 0)
        time.sleep(1)
        # Cyan (Green + Blue)
        set_color(0, 1, 1)
        time.sleep(1)
        # Magenta (Red + Blue)
        set_color(1, 0, 1)
        time.sleep(1)
        # White (Red + Green + Blue)
        set_color(1, 1, 1)
        time.sleep(1)
        # Off
        set_color(0, 0, 0)
        time.sleep(1)
except KeyboardInterrupt:
    # Turn off the LED before exiting
    set_color(0, 0, 0)