Initial Commit
This commit is contained in:
38
include/SlidingSquarePackedBitmap.h
Normal file
38
include/SlidingSquarePackedBitmap.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user