Driver for an RGB LED controlled by a TLC59731 driver through a single wire interface.
More...
#include <RGB_LED_TLC59731.h>
|
| | RGB_LED_TLC59731 (pin_size_t rgb_pin=LED_BUILTIN, pin_size_t enable_pin=NC) |
| | Construct the driver and select the pins used to drive the LED.
|
| |
| void | on (uint8_t rgb[3]) |
| | Set the RGB LED color.
|
| |
| void | on (uint8_t red, uint8_t green, uint8_t blue) |
| | Set the RGB LED color.
|
| |
|
void | off (void) |
| | Turn the RGB LED off and release its pins.
|
| |
| uint8_t | getBrightness (void) |
| | Get the current brightness value.
|
| |
| void | setBrightness (uint8_t value) |
| | Set the brightness value, applied to the predefined colors.
|
| |
|
|
static uint8_t | brightness = DEFAULT_BRIGHTNESS |
| | Current brightness value, used by the predefined colors.
|
| |
|
static uint8_t | OFF [3] = {0, 0, 0 } |
| | Predefined color: off (no light).
|
| |
|
static uint8_t | RED [3] = {DEFAULT_BRIGHTNESS, 0, 0 } |
| | Predefined color: red.
|
| |
|
static uint8_t | GREEN [3] = {0, DEFAULT_BRIGHTNESS, 0 } |
| | Predefined color: green.
|
| |
|
static uint8_t | BLUE [3] = {0, 0, DEFAULT_BRIGHTNESS} |
| | Predefined color: blue.
|
| |
|
static uint8_t | MAGENTA [3] = {DEFAULT_BRIGHTNESS, 0, DEFAULT_BRIGHTNESS} |
| | Predefined color: magenta.
|
| |
|
static uint8_t | CYAN [3] = {0, DEFAULT_BRIGHTNESS, DEFAULT_BRIGHTNESS} |
| | Predefined color: cyan.
|
| |
|
static uint8_t | YELLOW [3] = {DEFAULT_BRIGHTNESS, DEFAULT_BRIGHTNESS, 0 } |
| | Predefined color: yellow.
|
| |
|
static uint8_t | WHITE [3] = {DEFAULT_BRIGHTNESS, DEFAULT_BRIGHTNESS, DEFAULT_BRIGHTNESS} |
| | Predefined color: white.
|
| |
Driver for an RGB LED controlled by a TLC59731 driver through a single wire interface.
◆ RGB_LED_TLC59731()
| RGB_LED_TLC59731::RGB_LED_TLC59731 |
( |
pin_size_t |
rgb_pin = LED_BUILTIN, |
|
|
pin_size_t |
enable_pin = NC |
|
) |
| |
|
inline |
Construct the driver and select the pins used to drive the LED.
- Parameters
-
| rgb_pin | Pin connected to the TLC59731 data input. Default: LED_BUILTIN. |
| enable_pin | Pin connected to the TLC59731 enable line, NC if not used. Default: NC. |
◆ getBrightness()
| uint8_t RGB_LED_TLC59731::getBrightness |
( |
void |
| ) |
|
|
inline |
Get the current brightness value.
- Returns
- Brightness value.
◆ on() [1/2]
| void RGB_LED_TLC59731::on |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue |
|
) |
| |
Set the RGB LED color.
- Parameters
-
| red | Red value in range [0-255]. |
| green | Green value in range [0-255]. |
| blue | Blue value in range [0-255]. |
◆ on() [2/2]
| void RGB_LED_TLC59731::on |
( |
uint8_t |
rgb[3] | ) |
|
Set the RGB LED color.
The pins are configured on the first call.
- Parameters
-
| rgb | Array of red, green and blue values in range [0-255]. |
◆ setBrightness()
| void RGB_LED_TLC59731::setBrightness |
( |
uint8_t |
value | ) |
|
Set the brightness value, applied to the predefined colors.
The LED is not updated until on() is called with a predefined color.
- Parameters
-
| value | New brightness value in range [0-255]. |
The documentation for this class was generated from the following files:
- libraries/RGB_LED_TLC59731/src/RGB_LED_TLC59731.h
- libraries/RGB_LED_TLC59731/src/RGB_LED_TLC59731.cpp