|
direcs
2012-09-30
|
This class controls connected rgbLeds with PWM (brightness) More...
#include <rgbLed.h>

Public Slots | |
| void | init (void) |
| bool | setBrightness (unsigned char rgbLed, unsigned char bness) |
| void | setRobotState (bool state) |
Signals | |
| void | message (QString text) |
Public Member Functions | |
| unsigned char | getBrightness (int rgbLed, unsigned char type=RGBLEDACTUAL) |
| RgbLed (InterfaceAvr *i, QMutex *m) | |
| void | storeBrightness (int rgbLed, unsigned char type, unsigned char bness) |
| ~RgbLed () | |
Private Attributes | |
| int | brightness [NUMBEROFRGBLEDS] |
| QString | className |
| int | defaultBrightness [NUMBEROFRGBLEDS] |
| InterfaceAvr * | interface1 |
| int | maxBrightness [NUMBEROFRGBLEDS] |
| int | minBrightness [NUMBEROFRGBLEDS] |
| QMutex * | mutex |
| this will contain the name of this class at runtime. | |
| bool | robotState |
Static Private Attributes | |
| static const int | MAXPWM = 99 |
| this is analog to the value in microcontroller software | |
| static const int | MINPWM = 1 |
| For motor or robot "OFF". | |
| static const unsigned char | NUMBEROFRGBLEDS = 6 |
| defines the size of the rgbLed[] arrays. | |
| static const bool | OFF = false |
| For motor or robot "ON". | |
| static const bool | ON = true |
| the current position of the rgbLed! | |
| static const unsigned char | RGBLED1 = 0 |
| the RGB LED numbers | |
| static const unsigned char | RGBLED2 = 1 |
| static const unsigned char | RGBLED3 = 2 |
| static const unsigned char | RGBLED4 = 3 |
| static const unsigned char | RGBLED5 = 4 |
| static const unsigned char | RGBLED6 = 5 |
| static const unsigned char | RGBLEDACTUAL = 1 |
| static const unsigned char | RGBLEDDEFAULT = 0 |
| this is analog to the value in microcontroller software | |
| static const unsigned char | RGBLEDMAX = 3 |
| static const unsigned char | RGBLEDMIN = 2 |
| static const unsigned char | SET_RGBLED1 = 42 |
| the command for the microcontroller | |
| static const unsigned char | SET_RGBLED2 = 43 |
| static const unsigned char | SET_RGBLED3 = 44 |
| static const unsigned char | SET_RGBLED4 = 45 |
| static const unsigned char | SET_RGBLED5 = 46 |
| static const unsigned char | SET_RGBLED6 = 47 |
| static const unsigned long | THREADSLEEPTIME = 500 |
This class controls connected rgbLeds with PWM (brightness)
| RgbLed::RgbLed | ( | InterfaceAvr * | i, |
| QMutex * | m | ||
| ) |
Definition at line 23 of file rgbLed.cpp.
| RgbLed::~RgbLed | ( | ) |
Definition at line 45 of file rgbLed.cpp.
| unsigned char RgbLed::getBrightness | ( | int | rgbLed, |
| unsigned char | type = RGBLEDACTUAL |
||
| ) |
Returns the rgbLed start, end, default or current position.
| rgbLed | is the rgbLed number. |
| type | can be SVMIN, SVMAX, SVSTART, SVEND, SVDEFAULT or SVCURRENT=default |
Definition at line 147 of file rgbLed.cpp.

|
slot |
Inits all RGB LEDs to their default brightness.
Definition at line 134 of file rgbLed.cpp.


|
signal |
Emits a message to be displayed in the GUI or be used somewhere else (e.g. error message).

|
slot |
Sets the brightness of a RGB LED.
| rgbLed | is the RGBLED number. |
| bness | is the brightness. |
Definition at line 50 of file rgbLed.cpp.


|
slot |
This slots takes the robot (circuit) state, to know if the robot is ON or OFF. When the class knows this, unnecessary communication with the interface can be avoided.
| state | can be ON or OFF |
Definition at line 177 of file rgbLed.cpp.

| void RgbLed::storeBrightness | ( | int | rgbLed, |
| unsigned char | type, | ||
| unsigned char | bness | ||
| ) |
Stores the RGB LEDs minimum and maximum brightness and its default brightness.
| rgbLed | is the RGB LED number. |
| type | can be RGBLEDMIN, RGBLEDMAX, RGBLEDSTART, RGBLEDDEFAULT or RGBLEDACTUAL |
| bness | is the brightness (0 - 255). |
Definition at line 110 of file rgbLed.cpp.

|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
staticprivate |
|
mutableprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |