You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
the Adafruit library and driver bundle.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from
PyPI. To install for current user:
pip3 install adafruit-circuitpython-rgbled
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-rgbled
To install in a virtual environment in your current project:
Initialize a common-cathode RGB LED with three PWM-capable pins.
importboardimportadafruit_rgbled# Pin the Red LED is connected toRED_LED=board.D5# Pin the Green LED is connected toGREEN_LED=board.D6# Pin the Blue LED is connected toBLUE_LED=board.D7# Create a RGB LED objectled=adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED)
Initialize a common-anode RGB LED with three PWM-capable pins
importboardimportadafruit_rgbled# Pin the Red LED is connected toRED_LED=board.D5# Pin the Green LED is connected toGREEN_LED=board.D6# Pin the Blue LED is connected toBLUE_LED=board.D7# Create a RGB LED objectled=adafruit_rgbled.RGBLED(RED_LED, BLUE_LED, GREEN_LED, invert_pwm=True)
Set the RGB LED's color to a RGB Tuple (Red, Green, Blue).
led.color= (255, 0, 0)
Set the RGB LED's color to a 24-bit integer (in hex syntax), 0x100000.
led.color=0x100000
Setting a common-anode RGB LED using a ContextManager: