38 lines
894 B
C++
38 lines
894 B
C++
#ifndef SLIDINGSQUAREPACKEDBITMAP_H
|
|
#define SLIDINGSQUAREPACKEDBITMAP_H
|
|
|
|
#include <Arduino.h>
|
|
#include <FastLED.h>
|
|
#include "GlobalSettings.h"
|
|
#include "Animation.h"
|
|
#include "Utilities.h"
|
|
|
|
class SlidingSquarePackedBitmap : public Animation {
|
|
public:
|
|
SlidingSquarePackedBitmap(long _updateTime, const uint8_t* _bitmap, CRGB _color) :
|
|
Animation(_updateTime, (WIDTH - 8) * 2 * 5), bitmap(_bitmap), color(_color),
|
|
currentX(0), currentDirection(1) {}
|
|
|
|
void initialize(CRGB* leds) {
|
|
currentX = 0;
|
|
currentDirection = 1;
|
|
|
|
resetTimer();
|
|
|
|
Utilities::setAll(leds, MODE, CRGB::Black);
|
|
}
|
|
|
|
void execute(CRGB* leds);
|
|
|
|
private:
|
|
const uint8_t*
|
|
bitmap;
|
|
uint16_t
|
|
currentX;
|
|
int8_t
|
|
currentDirection;
|
|
CRGB
|
|
color;
|
|
};
|
|
|
|
#endif |