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:
-
ledCountNumberNumber of P9813 leds in the chain
-
clkPinNumberClock Pin
-
dataPinNumberData Pin
-
batchModeBoolean(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:
-
ledIdxNumberIndex of the LED in the chain (0 based)
-
rNumberRed component (0-255)
-
gNumberGreen component (0-255)
-
bNumberBlue component (0-255)
setAllLeds
-
r -
g -
b
Set the color for all LEDs
Parameters:
-
rNumberRed component (0-255)
-
gNumberGreen component (0-255)
-
bNumberBlue component (0-255)
setLeds
-
startIdx -
endIdx -
r -
g -
b
Set the color for a range of LEDs
Parameters:
-
startIdxNumberStart index of the range of LEDs in the chain (0 based)
-
endIdxNumberEnd index of the range of LEDs in the chain (0 based)
-
rNumberRed component (0-255)
-
gNumberGreen component (0-255)
-
bNumberBlue 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:
-
startIdxNumberStart index of the range of LEDs to update (0 based)
-
endIdxNumberEnd index of the range of LEDs to update (0 based)
-
colorsStd::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