chg: dev: add wrapper for setLED that takes three color arguments

This commit is contained in:
hhau 2023-12-06 00:06:10 +01:00
parent a108625ca9
commit b12e07539b
2 changed files with 27 additions and 0 deletions

View File

@ -42,11 +42,19 @@ void MultiColorLight::setLed(leds leds, uint32_t color){
};
void MultiColorLight::setLed(leds leds, uint8_t red, uint8_t green, uint8_t blue){
MultiColorLight::setLed(leds, MultiColorLight::color(red,green,blue));
};
void MultiColorLight::setTopLeds(uint32_t color){
MultiColorLight::setLed(TOP,color);
};
void MultiColorLight::setTopLeds(uint8_t red, uint8_t green, uint8_t blue){
MultiColorLight::setTopLeds(MultiColorLight::color(red,green,blue));
};
void MultiColorLight::blink(uint16_t amount,uint32_t color, leds leds, uint32_t interval){
for(uint16_t index = 0; index < amount;index++){
MultiColorLight::setLed(leds, color);

View File

@ -59,6 +59,16 @@ public:
*/
void setLed(leds leds, uint32_t color);
/**
* @brief Set the specified leds to the passed color value
*
* @param leds which leds should be updated
* @param red brightness of red, is normalized in the function
* @param green brightness of green, is normalized in the function
* @param blue brightness of blue, is normalized in the function
*/
void setLed(leds leds, uint8_t red, uint8_t green, uint8_t blue);
/**
* @brief sets the two leds on the top of the robot to the specified color
*
@ -68,6 +78,15 @@ public:
*/
void setTopLeds(uint32_t color);
/**
* @brief sets the two leds on the top of the robot to the specified color
*
* @param red brightness of red, is normalized in the function
* @param green brightness of green, is normalized in the function
* @param blue brightness of blue, is normalized in the function
*/
void setTopLeds(uint8_t red, uint8_t green, uint8_t blue);
/**
* @brief Let LEDs blink, returns after all blinks were executed
*