RGBLed API allows to easily interact with a RGB led to set its color for example.
More...
#include <RGBLed.h>
|
| RGBLed (IN uint8_t redPin, IN uint8_t greenPin, IN uint8_t bluePin) |
| Constructor for a COMMON CATODE RGBLed. More...
|
|
| RGBLed (IN uint8_t redPin, IN uint8_t greenPin, IN uint8_t bluePin, IN LedType ledType) |
| Constructor. More...
|
|
bool | begin () |
| Used to put the device ready to receive requests. More...
|
|
void | end () |
| Used to stop the device API. More...
|
|
void | turnOff () |
| Turns off the led. More...
|
|
void | setColor (IN uint8_t red, IN uint8_t green, IN uint8_t blue) |
| Set the led's color based on the RGB code. More...
|
|
void | setColor (IN char hexadecimalColorCode[8]) |
| Set the led's color based on the hexadecimal color code (highly used in web development) More...
|
|
void | setColor (IN Color color) |
| Set the led's color based in a set o pre defined colors. More...
|
|
| Device () |
| Constructor called by every sub-classes.
|
|
| ~Device () |
| Destroy all the resources associated with the device.
|
|
bool | isInitialized () const |
| Verify is the device is initialized and ready to use. More...
|
|
|
bool | _isInitialized |
| Used to know if the device API is initialized and ready to receive requests.
|
|
RGBLed API allows to easily interact with a RGB led to set its color for example.
◆ RGBLed() [1/2]
Easyuino::RGBLed::RGBLed |
( |
IN uint8_t |
redPin, |
|
|
IN uint8_t |
greenPin, |
|
|
IN uint8_t |
bluePin |
|
) |
| |
Constructor for a COMMON CATODE RGBLed.
- Parameters
-
redPin | Arduino pin connected do led's red pin |
greenPin | Arduino pin connected to led's green pin |
bluePin | Arduino pin connected to led's blue pin |
◆ RGBLed() [2/2]
Easyuino::RGBLed::RGBLed |
( |
IN uint8_t |
redPin, |
|
|
IN uint8_t |
greenPin, |
|
|
IN uint8_t |
bluePin, |
|
|
IN LedType |
ledType |
|
) |
| |
Constructor.
- Parameters
-
redPin | Arduino pin connected do led's red pin |
greenPin | Arduino pin connected to led's green pin |
bluePin | Arduino pin connected to led's blue pin |
ledType | Type of the RGB led |
◆ begin()
bool Easyuino::RGBLed::begin |
( |
| ) |
|
|
virtual |
Used to put the device ready to receive requests.
Normally this have some default behaviour some devices have other overload method with same name that receives other arguments to device customization.
- Returns
- True: If the device was initialized. False: Otherwise.
Implements Easyuino::Device.
◆ end()
void Easyuino::RGBLed::end |
( |
| ) |
|
|
virtual |
Used to stop the device API.
After this the the device will not process API requests.
Implements Easyuino::Device.
◆ setColor() [1/3]
void Easyuino::RGBLed::setColor |
( |
IN uint8_t |
red, |
|
|
IN uint8_t |
green, |
|
|
IN uint8_t |
blue |
|
) |
| |
Set the led's color based on the RGB code.
- Parameters
-
red | Red value (0-255) |
green | Green value (0-255) |
blue | Blue value (0-255) |
◆ setColor() [2/3]
void Easyuino::RGBLed::setColor |
( |
IN char |
hexadecimalColorCode[8] | ) |
|
Set the led's color based on the hexadecimal color code (highly used in web development)
- Parameters
-
hexadecimalColorCode | String that represents a valid hexadecimal color code (e.g: "#ffffff" to red color) |
◆ setColor() [3/3]
void Easyuino::RGBLed::setColor |
( |
IN Color |
color | ) |
|
Set the led's color based in a set o pre defined colors.
- Parameters
-
color | Value that represents the color |
◆ turnOff()
void Easyuino::RGBLed::turnOff |
( |
| ) |
|
Turns off the led.
It can be lit again using any setColor() methods.
The documentation for this class was generated from the following file: