Easyuino  1.2.0
Easyuino::RGBLed Class Reference

RGBLed API allows to easily interact with a RGB led to set its color for example. More...

#include <RGBLed.h>

Inheritance diagram for Easyuino::RGBLed:
Easyuino::Device

Public Member Functions

 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...
 
- Public Member Functions inherited from Easyuino::Device
 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...
 

Additional Inherited Members

- Protected Attributes inherited from Easyuino::Device
bool _isInitialized
 Used to know if the device API is initialized and ready to receive requests.
 

Detailed Description

RGBLed API allows to easily interact with a RGB led to set its color for example.

Constructor & Destructor Documentation

◆ 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
redPinArduino pin connected do led's red pin
greenPinArduino pin connected to led's green pin
bluePinArduino 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
redPinArduino pin connected do led's red pin
greenPinArduino pin connected to led's green pin
bluePinArduino pin connected to led's blue pin
ledTypeType of the RGB led

Member Function Documentation

◆ 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
redRed value (0-255)
greenGreen value (0-255)
blueBlue 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
hexadecimalColorCodeString 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
colorValue 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: