gusimplewhiteboard
|
Class for changing the LEDs on a robot, designed for Nao but is fairly generic. More...
#include <SENSORSLedsSensors.hpp>
Public Member Functions | |
SENSORSLedsSensors () | |
Constructor, sets all LED values to off. More... | |
void | LEDsGroupChange (LEDGroups target_group, LEDColour target_colour_or_numOfEars) |
Allows changes to be made to a group of LEDs. More... | |
void | changeLedColour (LEDs::LEDCode led[3], LEDColour colour) |
Colour mixer for RGB LEDs. More... | |
void | changeLed (LEDs::LEDCode led, bool state) |
Turn on or off an individual LED. More... | |
void | changeLed (LEDs::LEDCode led, u_int8_t level) |
Set the intensity value for an individual LED. More... | |
Class for changing the LEDs on a robot, designed for Nao but is fairly generic.
Change a group of LEDs
LEDsGroupChange(AllLEDs, Off); //turn all LEDs off LEDsGroupChange(Eyes, Red); //make the eyes completely red LEDsGroupChange(Ears, 5); //turn half of the ear LEDs on
Change a single LED, stateful: on / off
changeLed(LEDs::ChestRed, false);
Change a single LED, intensity: 0 == Off, 100 == Max
changeLed(LEDs::ChestRed, 0); changeLed(LEDs::ChestGreen, 0); changeLed(LEDs::ChestBlue, 100); //0 red, 0 green, 100 percent blue == Chest button turns blue
Definition at line 242 of file SENSORSLedsSensors.hpp.
|
inline |
Constructor, sets all LED values to off.
Definition at line 247 of file SENSORSLedsSensors.hpp.
References guWhiteboard::AllLEDs, LEDsGroupChange(), and guWhiteboard::Off.
|
inline |
Turn on or off an individual LED.
led | The LED to change |
state | on or off |
Definition at line 397 of file SENSORSLedsSensors.hpp.
References changeLed(), and u_int8_t.
Referenced by changeLed(), changeLedColour(), and LEDsGroupChange().
|
inline |
Set the intensity value for an individual LED.
led | The LED to change |
level | the new intensity value. Range: 0 - 100 |
Definition at line 406 of file SENSORSLedsSensors.hpp.
|
inline |
Colour mixer for RGB LEDs.
led | 0 == Red, 1 == Green, 2 == Blue LEDs |
colour | the target colour |
Definition at line 353 of file SENSORSLedsSensors.hpp.
References guWhiteboard::Blue, changeLed(), guWhiteboard::Green, guWhiteboard::NUMBER_OF_LEDS_COLOURS, guWhiteboard::Off, guWhiteboard::Red, u_int8_t, guWhiteboard::White, and guWhiteboard::Yellow.
Referenced by LEDsGroupChange().
|
inline |
Allows changes to be made to a group of LEDs.
target_group | The LED group to be changed |
target_colour_or_numOfEars | The colour to change to, this is also a counter in the case of the Ears which can only be blue anyway. ie Ears 5 == turn on five ear LEDs, Eyes Red == change the eye colours to red |
Definition at line 256 of file SENSORSLedsSensors.hpp.
References guWhiteboard::AllLEDs, changeLed(), changeLedColour(), guWhiteboard::Chest, guWhiteboard::LEDs::ChestBlue, guWhiteboard::LEDs::ChestGreen, guWhiteboard::LEDs::ChestRed, guWhiteboard::Ears, guWhiteboard::Eyes, guWhiteboard::Feet, guWhiteboard::LEar, guWhiteboard::LEDs::LeftEar1, guWhiteboard::LEDs::LeftEar10, guWhiteboard::LEDs::LeftEyeBlue1, guWhiteboard::LEDs::LeftEyeGreen1, guWhiteboard::LEDs::LeftEyeRed1, guWhiteboard::LEDs::LeftEyeRed8, guWhiteboard::LEDs::LeftFootBlue, guWhiteboard::LEDs::LeftFootGreen, guWhiteboard::LEDs::LeftFootRed, guWhiteboard::LEye, guWhiteboard::LFoot, guWhiteboard::LEDs::NUMBER_OF_LEDS, guWhiteboard::NUMBER_OF_LEDS_GROUPS, guWhiteboard::REar, guWhiteboard::REye, guWhiteboard::RFoot, guWhiteboard::LEDs::RightEar1, guWhiteboard::LEDs::RightEar10, guWhiteboard::LEDs::RightEyeBlue1, guWhiteboard::LEDs::RightEyeGreen1, guWhiteboard::LEDs::RightEyeRed1, guWhiteboard::LEDs::RightEyeRed8, guWhiteboard::LEDs::RightFootBlue, guWhiteboard::LEDs::RightFootGreen, and guWhiteboard::LEDs::RightFootRed.
Referenced by SENSORSLedsSensors().