P9813 Class
- ID: p9813
- Name: Chainable RGB LED driver
- Category: led
- Manufacturer: adafruit
- Connection: gpio
- Link: https://www.adafruit.com/product/2343
P9813 LED controller provides individually controllable LEDs through a two pin protocol For each LED, an RGB (0-255) value can be set.
Methods
P9813
-
ledCount
-
clkPin
-
dataPin
-
batchMode
Instantiates a new P9813 LED chain
Parameters:
-
ledCount
NumberNumber of P9813 leds in the chain
-
clkPin
NumberClock Pin
-
dataPin
NumberData Pin
-
batchMode
Boolean(optional) Immediately write to the LED controllers (false, default) or wait for a pushState call (true)
Returns:
setLed
-
ledIdx
-
r
-
g
-
b
Set the color for a single LED
Parameters:
-
ledIdx
NumberIndex of the LED in the chain (0 based)
-
r
NumberRed component (0-255)
-
g
NumberGreen component (0-255)
-
b
NumberBlue component (0-255)
setAllLeds
-
r
-
g
-
b
Set the color for all LEDs
Parameters:
-
r
NumberRed component (0-255)
-
g
NumberGreen component (0-255)
-
b
NumberBlue component (0-255)
setLeds
-
startIdx
-
endIdx
-
r
-
g
-
b
Set the color for a range of LEDs
Parameters:
-
startIdx
NumberStart index of the range of LEDs in the chain (0 based)
-
endIdx
NumberEnd index of the range of LEDs in the chain (0 based)
-
r
NumberRed component (0-255)
-
g
NumberGreen component (0-255)
-
b
NumberBlue component (0-255)
setLeds
-
startIdx
-
endIdx
-
colors
(Advanced) Manually control the colors and brightness of a range of LEDS Best used to maximize performance
Parameters:
-
startIdx
NumberStart index of the range of LEDs to update (0 based)
-
endIdx
NumberEnd index of the range of LEDs to update (0 based)
-
colors
Std::vector RgbColorVector containing RgbColor structures for each LED No check done on the boundaries
pushState
()
Outputs the current LED data to the LED controllers Note: Only required if batch mode is set to TRUE