Wemos D1 Mini Frimware zur Steuerung einer RGBW-LED-Lampe
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

LEDStripManager.h 1.2KB

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