mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 10:04:31 +02:00
chg: dev: first version of multiColorLight implemeted
This commit is contained in:
@ -26,8 +26,14 @@ enum leds{
|
||||
};
|
||||
|
||||
class MultiColorLight{
|
||||
protected:
|
||||
static const uint16_t ledAmount = 3;
|
||||
static const int16_t ledPin = 48;
|
||||
static const uint8_t maxBrightness = 100;
|
||||
Adafruit_NeoPixel rgbLeds;
|
||||
public:
|
||||
|
||||
MultiColorLight();
|
||||
/**
|
||||
* @brief initialize the multicolor component
|
||||
*
|
||||
@ -94,7 +100,21 @@ public:
|
||||
* component, and BB is the blue component.
|
||||
*/
|
||||
uint32_t color(uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief normalizes every component of color to not exeed the maxBrightness
|
||||
*
|
||||
* @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.
|
||||
* @param maxBrigthness maximal level of brightness that is allowed for each color
|
||||
* @return uint32_t 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. Where each component can be
|
||||
* between 0 - maxBrightness
|
||||
*/
|
||||
uint32_t normalizeColor(uint32_t color, uint8_t maxBrigthness=maxBrightness);
|
||||
};
|
||||
|
||||
#endif //MultiColorLight_h
|
Reference in New Issue
Block a user