cable Wire an RGB LED
An RGB LED has four legs. GND is the long leg.
# 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.