Wemos D1 Mini Frimware zur Steuerung einer RGBW-LED-Lampe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LEDStripManager.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef LEDSTRIPEMANAGER_H
  2. #define LEDSTRIPEMANAGER_H
  3. #include "Arduino.h"
  4. #include <Adafruit_NeoPixel.h>
  5. #include "ConfigManager.h"
  6. #include "LEDModes.h"
  7. const int LED_STRIP_POWER_PIN = D2; // The pin to switch on / off the LED stripe
  8. const int LED_STRIP_DATA_PIN = D8; // The pin to switch control the LED stripe
  9. class LEDStripManager {
  10. public:
  11. LEDStripManager(uint16_t numLeds, uint8_t pin, ConfigManager &configManager);
  12. virtual ~LEDStripManager();
  13. void begin();
  14. void clear();
  15. void show();
  16. void on();
  17. void off();
  18. void setBrightness(uint8_t brightness);
  19. void setPixel(uint16_t index, uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
  20. void setAll(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
  21. void rainbow(uint8_t wait);
  22. void onModeChange(LEDModes mode);
  23. void onColorChange(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
  24. void onBrightnessChange(uint8_t brightness);
  25. private:
  26. Adafruit_NeoPixel strip;
  27. ConfigManager &configManager;
  28. uint32_t wheel(uint8_t pos);
  29. };
  30. #endif