41 lines
677 B
C++
41 lines
677 B
C++
/*
|
|
* ESP8266 RGBW controller
|
|
* Copyright 2020 (c) Mark van Renswoude
|
|
*
|
|
* https://git.x2software.net/pub/RGBWifi
|
|
*/
|
|
#ifndef __Strip
|
|
#define __Strip
|
|
|
|
#include <NeoPixelBus.h>
|
|
#include "./config.h"
|
|
|
|
|
|
enum StripSetting
|
|
{
|
|
Static = 0,
|
|
Rainbow = 1,
|
|
RainbowMoving = 2
|
|
};
|
|
|
|
class Strip
|
|
{
|
|
private:
|
|
NeoPixelBus<NeoPixelBusFeature, NeoPixelBusMethod>* mBus;
|
|
|
|
StripSetting mSetting;
|
|
uint32_t mLastTick;
|
|
uint32_t mDelay;
|
|
uint16_t mRainbowShift;
|
|
|
|
void update();
|
|
void tickRainbow();
|
|
public:
|
|
void init(uint16_t ledCount);
|
|
void tick();
|
|
|
|
void setStatic(const RgbwColor color);
|
|
void setRainbow(uint16_t speed, uint8_t lightness);
|
|
};
|
|
|
|
#endif |