Wemos D1 Mini Frimware zur Steuerung einer RGBW-LED-Lampe
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

LEDStripManager.h 754B

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