I'm tired and forgot to add two files to previous commits. :-/

This commit is contained in:
Fabian Schlenz 2019-06-19 22:29:11 +02:00
parent ead076f9a3
commit 77fdba213a
2 changed files with 21 additions and 8 deletions

View File

@ -21,3 +21,11 @@ class MultiDynamicEffect : public SingleDynamicEffect {
public:
void loop();
};
class BigDynamicEffect : public Effect {
private:
Window* window = new Window(0, 0, LED_WIDTH, LED_HEIGHT-6);
public:
void loop();
~BigDynamicEffect();
};

View File

@ -11,6 +11,11 @@ void Window::setPixel(uint8_t x, uint8_t y, CRGB* color) {
leds[this->coordsToGlobalIndex(x, y)] = *color;
}
void Window::raisePixel(uint8_t x, uint8_t y, CRGB* color) {
if (x>=this->width || y>=this->height) return;
leds[this->coordsToGlobalIndex(x, y)] |= *color;
}
void Window::setPixelByIndex(uint16_t index, CRGB* color) {
uint8_t x = index % this->width;
uint8_t y = index / this->width;