« Back to documentation index
RGB Class Reference
RGB-Led class A RGB-LED class to control RGB-Leds.
More...
#include <rgb.h >
Public Member Functions
RGB (PinName r_pin , PinName g_pin , PinName b_pin )
Create RGB instance.
void setColor (Color *color )
setColor instance This will set the color
void setColor (int red, int green, int blue)
setColor instance with RGB This will set the color with given values red, green, blue
void setColor (int color )
setColor instance with integer color This will set the color with given integer
Color * getColor ()
getColor instance This will return the current color in a Color* object
void Off ()
Off instance This will turn off all the leds.
void invertColor (Color *color )
invertColor instance This will invert every color
Data Fields
PinName r_pin
pinNames r_pin declaration Declaration of PinName r_pin
PinName b_pin
pinNames b_pin declaration Declaration of PinName b_pin
PinName g_pin
pinNames g_pin declaration Declaration of PinName g_pin
Color * color
color declaration of type Color* Declaration of Color* color
PwmOut * r_out
PwmOut r_out declaration Declaration of PwmOut r_out.
PwmOut * b_out
PwmOut b_out declaration Declaration of PwmOut b_out.
PwmOut * g_out
PwmOut g_out declaration Declaration of PwmOut g_out.
Static Public Attributes
static const int MAX_COLOR_VALUE = 255
static const int MAX_COLOR_VALUE Sets the maximum color value, 255 for RGB
Detailed Description
RGB-Led class A RGB-LED class to control RGB-Leds.
Definition at line 10 of file rgb.h .
Constructor & Destructor Documentation
RGB
(
PinName
r_pin ,
PinName
g_pin ,
PinName
b_pin
)
Create RGB instance.
Definition at line 4 of file rgb.cpp .
Member Function Documentation
getColor instance This will return the current color in a Color* object
Definition at line 35 of file rgb.cpp .
void invertColor
(
Color *
color )
invertColor instance This will invert every color
Definition at line 24 of file rgb.cpp .
Off instance This will turn off all the leds.
Definition at line 31 of file rgb.cpp .
void setColor
(
int
red ,
int
green ,
int
blue
)
setColor instance with RGB This will set the color with given values red, green, blue
Definition at line 17 of file rgb.cpp .
void setColor
(
int
color )
setColor instance with integer color This will set the color with given integer
Definition at line 20 of file rgb.cpp .
void setColor
(
Color *
color )
setColor instance This will set the color
Definition at line 10 of file rgb.cpp .
Field Documentation
PwmOut b_out declaration Declaration of PwmOut b_out.
Definition at line 69 of file rgb.h .
pinNames b_pin declaration Declaration of PinName b_pin
Definition at line 49 of file rgb.h .
color declaration of type Color* Declaration of Color* color
Definition at line 57 of file rgb.h .
PwmOut g_out declaration Declaration of PwmOut g_out.
Definition at line 73 of file rgb.h .
pinNames g_pin declaration Declaration of PinName g_pin
Definition at line 53 of file rgb.h .
static const int MAX_COLOR_VALUE Sets the maximum color value, 255 for RGB
Definition at line 77 of file rgb.h .
PwmOut r_out declaration Declaration of PwmOut r_out.
Definition at line 65 of file rgb.h .
pinNames r_pin declaration Declaration of PinName r_pin
Definition at line 45 of file rgb.h .