pyupm_p9813 module

class pyupm_p9813.P9813(ledCount, clkPin, dataPin, batchMode=False)[source]

Bases: object

API for controlling P9813/Chainable RGB LEDs.

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.

C++ includes: p9813.hpp

pushState()[source]

void pushState()

Outputs the current LED data to the LED controllers Note: Only required if batch mode is set to TRUE

setAllLeds(r, g, b)[source]

void setAllLeds(uint8_t r, uint8_t g, uint8_t b)

Set the color for all LEDs

r: Red component (0-255)

g: Green component (0-255)

b: Blue component (0-255)

setLed(ledIdx, r, g, b)[source]

void setLed(uint16_t ledIdx, uint8_t r, uint8_t g, uint8_t b)

Set the color for a single LED

ledIdx: Index of the LED in the chain (0 based)

r: Red component (0-255)

g: Green component (0-255)

b: Blue component (0-255)

setLeds(*args)[source]

void setLeds(uint16_t startIdx, uint16_t endIdx, std::vector< RgbColor > colors)

(Advanced) Manually control the colors and brightness of a range of LEDS Best used to maximize performance

startIdx: Start index of the range of LEDs to update (0 based)

endIdx: End index of the range of LEDs to update (0 based)

colors: Vector containing RgbColor structures for each LED No check done on the boundaries

class pyupm_p9813.RgbColor[source]

Bases: object

blue
green
red