Use this code with RGB-LEDs.
More...
|
| RGBTools (uint8_t r, uint8_t g, uint8_t b) |
|
| RGBTools (uint8_t r, uint8_t g, uint8_t b, Mode mode) |
|
void | setColor (uint8_t r, uint8_t g, uint8_t b) |
|
void | setColor (uint32_t) |
|
void | fadeTo (uint8_t r, uint8_t g, uint8_t b, int steps, int duration) |
|
Use this code with RGB-LEDs.
This class implements methods to control a RGB LED with Arduino
RGBTools::RGBTools |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
constructor; saves the pins
- Parameters
-
[in] | r | The Arduino pin number of the red pin of the LED |
[in] | g | The Arduino pin number of the green pin of the LED |
[in] | b | The Arduino pin number of the blue pin of the LED |
RGBTools::RGBTools |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
Mode |
mode |
|
) |
| |
Constructor using the Mode enum in header file. Ex: RGBTools(9, 10, 11, COMMON_ANODE);
- Parameters
-
[in] | r | The Arduino pin number of the red pin of the LED |
[in] | g | The Arduino pin number of the green pin of the LED |
[in] | b | The Arduino pin number of the blue pin of the LED |
[in] | mode | The mode of the RGB (common cathode / common anode) |
void RGBTools::fadeTo |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
int |
steps, |
|
|
int |
duration |
|
) |
| |
Fades to custom color in specific time in specific steps
- Parameters
-
[in] | r | The red value ([0-255]) |
[in] | g | The green value ([0-255]) |
[in] | b | The blue value ([0-255]) |
[in] | steps | The number of steps to use |
[in] | duration | The duration of the fading in ms |
void RGBTools::setColor |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
Set LED-color to custom color instantly
- Parameters
-
[in] | r | The red value ([0-255]) |
[in] | g | The green value ([0-255]) |
[in] | b | The blue value ([0-255]) |
void RGBTools::setColor |
( |
uint32_t |
color | ) |
|
Set LED-color to custom color instantly Uses a 32 bit value to set a color.
- Parameters
-
[in] | color | The 32 bit color value (eg. 0xFF0000 for red) |
The documentation for this class was generated from the following files: