34 lines
748 B
C++
34 lines
748 B
C++
#ifndef ALTERNATESTRIP_H
|
|
#define ALTERNATESTRIP_H
|
|
|
|
#include "LEDHAL.h"
|
|
#include "StripAnimation.h"
|
|
|
|
class AlternateStrip : public StripAnimation {
|
|
public:
|
|
AlternateStrip(LEDHAL* _strip, char* _refName, long _updateTime, CRGB* _colors,
|
|
uint8_t _numColors) : StripAnimation(_strip, _refName, _updateTime),
|
|
numColors(_numColors), colors(new CRGB[_numColors]), alternateInt(0) {
|
|
|
|
for(uint8_t i = 0; i < _numColors; i++) {
|
|
colors[i] = _colors[i];
|
|
}
|
|
}
|
|
virtual ~AlternateStrip() { delete colors; }
|
|
|
|
void initialize() {
|
|
alternateInt = 0;
|
|
resetTimer();
|
|
}
|
|
|
|
void execute();
|
|
private:
|
|
uint16_t
|
|
alternateInt;
|
|
CRGB*
|
|
colors;
|
|
uint8_t
|
|
numColors;
|
|
};
|
|
|
|
#endif |