Initial Commit
This commit is contained in:
38
include/Alternate.h
Normal file
38
include/Alternate.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef ALTERNATE
|
||||
#define ALTERNATE
|
||||
|
||||
#include "Animation.h"
|
||||
#include "GlobalSettings.h"
|
||||
#include "Utilities.h"
|
||||
#include <FastLED.h>
|
||||
|
||||
class Alternate : public Animation {
|
||||
public:
|
||||
Alternate(long _updateTime, uint16_t _alternateSize, CRGB* _colors, uint8_t _numColors) :
|
||||
Animation(_updateTime, 10 * _numColors), numColors(_numColors), colors(new CRGB[_numColors]),
|
||||
alternateInt(0), alternateSize(_alternateSize) {
|
||||
for(uint8_t i = 0; i < _numColors; i++) {
|
||||
colors[i] = _colors[i];
|
||||
}
|
||||
}
|
||||
|
||||
void initialize(CRGB* leds) {
|
||||
alternateInt = 0;
|
||||
resetTimer();
|
||||
|
||||
Utilities::setAll(leds, NUMLEDS, CRGB::Black);
|
||||
}
|
||||
|
||||
void execute(CRGB* leds);
|
||||
private:
|
||||
uint16_t
|
||||
alternateInt,
|
||||
alternateSize;
|
||||
CRGB*
|
||||
colors;
|
||||
uint8_t
|
||||
numColors;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user