from machine import Pin, PWM
import utime

# Define RGB LED pins
common_pin = Pin(0, Pin.OUT)   # GPIO pin 0
red_pin = Pin(1, Pin.OUT)      # GPIO pin 1
green_pin = Pin(2, Pin.OUT)    # GPIO pin 2
blue_pin = Pin(3, Pin.OUT)     # GPIO pin 3

# Create PWM objects for smooth color blending
red_pwm = PWM(red_pin)
green_pwm = PWM(green_pin)
blue_pwm = PWM(blue_pin)

# Function to set RGB color with high brightness
def set_color(red, green, blue):
    common_pin.value(1)  # Turn on common pin
    red_pwm.duty_u16(int(red * 65535 / 255))
    green_pwm.duty_u16(int(green * 65535 / 255))
    blue_pwm.duty_u16(int(blue * 65535 / 255))

# Main loop
while True:
    # Red (high brightness)
    set_color(255, 0, 0)
    utime.sleep(1)
    # Green (high brightness)
    set_color(0, 255, 0)
    utime.sleep(1)
    # Blue (high brightness)
    set_color(0, 0, 255)
    utime.sleep(1)

pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
rgb1:R
rgb1:COM
rgb1:G
rgb1:B