G.U.L.L.S. rebuilt to use PlatformIO
This commit is contained in:
46
include/AlternateMatrix.h
Normal file
46
include/AlternateMatrix.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef ALTERNATEMATRIX_H
|
||||
#define ALTERNATEMATRIX_H
|
||||
|
||||
#include "LEDHAL2D.h"
|
||||
#include "MatrixAnimation.h"
|
||||
|
||||
enum AlternateType {
|
||||
HORIZONTAL_ALTERNATE,
|
||||
VERTICAL_ALTERNATE
|
||||
};
|
||||
|
||||
class AlternateMatrix : public MatrixAnimation {
|
||||
public:
|
||||
AlternateMatrix(LEDHAL2D* _matrix, char* _refName, long _updateTime, CRGB* _colors,
|
||||
uint8_t _numColors, AlternateType _type) : MatrixAnimation(_matrix, _refName, _updateTime),
|
||||
numColors(_numColors), colors(new CRGB[_numColors]), alternateInt(0), type(_type) {
|
||||
|
||||
for(uint8_t i = 0; i < _numColors; i++) {
|
||||
colors[i] = _colors[i];
|
||||
}
|
||||
}
|
||||
virtual ~AlternateMatrix() { delete colors; }
|
||||
|
||||
void initialize() {
|
||||
alternateInt = 0;
|
||||
resetTimer();
|
||||
}
|
||||
|
||||
void execute();
|
||||
|
||||
AlternateType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
private:
|
||||
uint16_t
|
||||
alternateInt;
|
||||
CRGB*
|
||||
colors;
|
||||
uint8_t
|
||||
numColors;
|
||||
AlternateType
|
||||
type;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user