RGBLED
1.0.0
Easily control RGB LEDs.
|
Public Member Functions | |
RGBLED (uint8_t red_pin, uint8_t green_pin, uint8_t blue_pin, CommonElectrode commonElectrode=CommonElectrode::cathode) | |
The class constructor. More... | |
void | on () |
Turns the LED ON. More... | |
void | off () |
Turns the LED OFF. More... | |
State | state () const |
Returns the state of the LED. More... | |
uint8_t | brightness () const |
Returns the brightness of the LED. More... | |
void | brightness (uint8_t brightness) |
Sets the LED's brightness. More... | |
void | operator() (uint8_t brightness) |
Sets the LED's brightness. More... | |
uint8_t | red () const |
Returns the red value. More... | |
void | red (uint8_t redValue) |
Sets the red value. More... | |
uint8_t | green () const |
Returns the green value. More... | |
void | green (uint8_t greenValue) |
Sets the green value. More... | |
uint8_t | blue () const |
Returns the blue value. More... | |
void | blue (uint8_t blueValue) |
Sets the blue value. More... | |
void | operator() (uint8_t redValue, uint8_t greenValue, uint8_t blueValue) |
Sets the RGB values simultaneously. More... | |
uint8_t | red_correction () const |
Returns the red correction. More... | |
void | red_correction (uint8_t red_correction) |
Sets the red correction. More... | |
uint8_t | green_correction () const |
Returns the green correction. More... | |
void | green_correction (uint8_t green_correction) |
Sets the green correction. More... | |
uint8_t | blue_correction () const |
Returns the blue correction. More... | |
void | blue_correction (uint8_t blue_correction) |
Sets the blue correction. More... | |
void | show (bool force=false) const |
Updates the LEDs with the current settings. More... | |
RGBLED::RGBLED | ( | uint8_t | red_pin, |
uint8_t | green_pin, | ||
uint8_t | blue_pin, | ||
CommonElectrode | commonElectrode = CommonElectrode::cathode |
||
) |
The class constructor.
red_pin | - the pin connected to red |
green_pin | - the pin connected to green |
blue_pin | - the pin connected to blue |
commonElectrode | - specifies the LED's common electrode |
uint8_t RGBLED::blue | ( | ) | const |
Returns the blue value.
void RGBLED::blue | ( | uint8_t | blueValue | ) |
Sets the blue value.
blueValue | - the blue value |
uint8_t RGBLED::blue_correction | ( | ) | const |
Returns the blue correction.
void RGBLED::blue_correction | ( | uint8_t | blue_correction | ) |
Sets the blue correction.
blue_correction | - the blue correction |
uint8_t RGBLED::brightness | ( | ) | const |
Returns the brightness of the LED.
void RGBLED::brightness | ( | uint8_t | brightness | ) |
Sets the LED's brightness.
brightness | - the brightness value |
uint8_t RGBLED::green | ( | ) | const |
Returns the green value.
void RGBLED::green | ( | uint8_t | greenValue | ) |
Sets the green value.
greenValue | - the green value |
uint8_t RGBLED::green_correction | ( | ) | const |
Returns the green correction.
void RGBLED::green_correction | ( | uint8_t | green_correction | ) |
Sets the green correction.
green_correction | - the green correction |
void RGBLED::off | ( | ) |
Turns the LED OFF.
void RGBLED::on | ( | ) |
Turns the LED ON.
void RGBLED::operator() | ( | uint8_t | brightness | ) |
Sets the LED's brightness.
brightness | - the brightness value |
void RGBLED::operator() | ( | uint8_t | redValue, |
uint8_t | greenValue, | ||
uint8_t | blueValue | ||
) |
Sets the RGB values simultaneously.
redValue | - the red value |
greenValue | - the green value |
blueValue | - the blue value |
uint8_t RGBLED::red | ( | ) | const |
Returns the red value.
void RGBLED::red | ( | uint8_t | redValue | ) |
Sets the red value.
redValue | - the red value |
uint8_t RGBLED::red_correction | ( | ) | const |
Returns the red correction.
void RGBLED::red_correction | ( | uint8_t | red_correction | ) |
Sets the red correction.
red_correction | - the red correction |
void RGBLED::show | ( | bool | force = false | ) | const |
Updates the LEDs with the current settings.
force | - forces the update (otherwise update could be skipped if there wasn't a change) |
State RGBLED::state | ( | ) | const |