Dezibot 4
MultiColorLight.h
Go to the documentation of this file.
1 
11 #ifndef MultiColorLight_h
12 #define MultiColorLight_h
13 #include <Adafruit_NeoPixel.h>
14 #include "ColorConstants.h"
20 enum leds{
24  TOP,
25  ALL
26 };
27 
29 protected:
30  static const uint16_t ledAmount = 3;
31  static const int16_t ledPin = 48;
32  static const uint8_t maxBrightness = 150;
33  Adafruit_NeoPixel rgbLeds;
34 public:
35 
41  void begin(void);
42 
50  void setLed(uint8_t index , uint32_t color);
51 
60  void setLed(leds leds, uint32_t color);
61 
70  void setLed(leds leds, uint8_t red, uint8_t green, uint8_t blue);
71 
79  void setTopLeds(uint32_t color);
80 
88  void setTopLeds(uint8_t red, uint8_t green, uint8_t blue);
89 
102  void blink(uint16_t amount,uint32_t color = 0x00006400,leds leds=TOP, uint32_t interval=1000);
103 
109  void turnOffLed(leds leds=ALL);
110 
121  uint32_t color(uint8_t r, uint8_t g, uint8_t b);
122 
123 private:
136  uint32_t normalizeColor(uint32_t color, uint8_t maxBrigthness=maxBrightness);
137 };
138 
139 #endif //MultiColorLight_h
color
leds
Describes combinations of leds on the Dezibot. With the Robot in Front of you, when the robot drives ...
@ TOP
@ TOP_LEFT
@ BOTTOM
@ TOP_RIGHT
@ ALL
void turnOffLed(leds leds=ALL)
turn off the given leds
void blink(uint16_t amount, uint32_t color=0x00006400, leds leds=TOP, uint32_t interval=1000)
Let LEDs blink, returns after all blinks were executed.
static const uint16_t ledAmount
void setLed(uint8_t index, uint32_t color)
Set the specified led to the passed color.
void begin(void)
initialize the multicolor component
uint32_t color(uint8_t r, uint8_t g, uint8_t b)
wrapper to calulate the used colorformat from a rgb-value
static const uint8_t maxBrightness
Adafruit_NeoPixel rgbLeds
static const int16_t ledPin
void setTopLeds(uint32_t color)
sets the two leds on the top of the robot to the specified color