Multicolour RGB LEDs

cable

Multicolour RGB LEDs

cable

cable Wire an RGB LED

An RGB LED connected to the Raspberry Pi Pico GND, GP1 for red, GP2 for green, and GP3 for blue have been used.
An RGB LED has four legs. GND is the long leg.

play_circle stop_circle
# Import the RGBLED component
from picozero import RGBLED
from time import sleep

# Set up RGBLED with correct pin numbers
rgb = RGBLED(red = 1, green = 2, blue = 3)

# Choose colours and control your RGBLED
rgb.color = (0, 255, 0) # maximum green
sleep(1)
rgb.color = (255, 0, 100) # pink
🟦 = 0, 0, 255   🟪 = 128, 0, 128   🟧 = 255, 165, 0

bug_report My RGBLED doesn't light correctly

  • Check that the legs are connected in the correct order.
  • Check your connections.
  • Check the pin numbers in your code.