| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef LEDSTRIPEMANAGER_H
- #define LEDSTRIPEMANAGER_H
-
- #include "Arduino.h"
- #include <Adafruit_NeoPixel.h>
- #include "ConfigManager.h"
- #include "LEDModes.h"
-
- const int LED_STRIP_POWER_PIN = D2; // The pin to switch on / off the LED stripe
- const int LED_STRIP_DATA_PIN = D8; // The pin to switch control the LED stripe
-
- class LEDStripManager {
-
- public:
- LEDStripManager(uint16_t numLeds, uint8_t pin, ConfigManager &configManager);
-
- virtual ~LEDStripManager();
-
- void begin();
-
- void clear();
-
- void show();
-
- void on();
-
- void off();
-
- void setBrightness(uint8_t brightness);
-
- void setPixel(uint16_t index, uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
-
- void setAll(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
-
- void rainbow(uint8_t wait);
-
- void onModeChange(LEDModes mode);
-
- void onColorChange(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
-
- void onBrightnessChange(uint8_t brightness);
-
- private:
- Adafruit_NeoPixel strip;
-
- ConfigManager &configManager;
-
- uint32_t wheel(uint8_t pos);
- };
-
- #endif
|