Wemos D1 Mini Frimware zur Steuerung einer RGBW-LED-Lampe
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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();
  22. void setSegments();
  23. void flash();
  24. void doSpectral();
  25. void fade();
  26. void onModeChange(LEDModes mode);
  27. void onColorChange(String cfgVal, uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
  28. void onBrightnessChange(uint8_t brightness);
  29. void onCfgParamChange(String cfgVal, uint32_t amount);
  30. private:
  31. Adafruit_NeoPixel strip;
  32. uint32_t firstPixelHue = 0;
  33. ConfigManager &configManager;
  34. uint32_t wheel(uint8_t pos);
  35. };
  36. #endif