fix: dev: switched left and right leds

This commit is contained in:
hhau
2023-12-06 00:02:09 +01:00
parent 11ac0494d5
commit 4be496759f
2 changed files with 7 additions and 3 deletions

View File

@ -20,6 +20,8 @@ void MultiColorLight::setLed(uint8_t index , uint32_t color){
void MultiColorLight::setLed(leds leds, uint32_t color){
switch (leds){
case TOP_LEFT:
MultiColorLight::setLed(1,color);break;
case TOP_RIGHT:
MultiColorLight::setLed(0,color);break;
case TOP_RIGHT:
MultiColorLight::setLed(1,color);break;
@ -30,7 +32,7 @@ void MultiColorLight::setLed(leds leds, uint32_t color){
MultiColorLight::setLed(index,color);
}break;
case ALL:
for (int index = 0; index<3; index++){
for (int index = 0; index<ledAmount; index++){
MultiColorLight::setLed(index,color);
}break;
default:
@ -58,6 +60,8 @@ void MultiColorLight::blink(uint16_t amount,uint32_t color, leds leds, uint32_t
void MultiColorLight::turnOff(leds leds){
switch (leds){
case TOP_LEFT:
MultiColorLight::setLed(1,0);break;
case TOP_RIGHT:
MultiColorLight::setLed(0,0);break;
case TOP_RIGHT:
MultiColorLight::setLed(1,0);break;

View File

@ -14,7 +14,7 @@
#include "ColorConstants.h"
/**
* @brief Describes combinations of leds on the Dezibot.
* With the Robot in Front of you, if you can read the Dezibotlogo, the LED left from the Logo is TOP_LEFT
* With the Robot in Front of you, when the robot drives away from you, the left LED is TOP_LEFT
*
*/
enum leds{
@ -42,7 +42,7 @@ public:
/**
* @brief Set the specified led to the passed color
* @param index ranging from 0-2, 0: Left, 1: Right, 2: Bottom
* @param index ranging from 0-2, 0: Right, 1: Left, 2: Bottom
* @param color A 32-bit unsigned integer representing the color in the format
* 0x00RRGGBB, where RR is the red component, GG is the green
* component, and BB is the blue component. Each color can range between 0 to 100