Fabian Schlenz
382631d7d7
the effects to show animations that stay fluid independent of the current frame rate.
20 lines
500 B
C++
20 lines
500 B
C++
#include "Effect.h"
|
|
#include "functions.h"
|
|
#include "effect_bell.h"
|
|
#include "sprites.h"
|
|
|
|
void BellEffect::loop(uint16_t ms) {
|
|
Serial.println("This is Bell.loop()");
|
|
for (int y = 0; y < 16; y++) {
|
|
for (int x = 0; x < 2; x++) {
|
|
for (int z = 0; z < 8; z++) {
|
|
leds[XYsafe(x * 8 + z, y)] = (sprite_bell[y * 2 + x] >> (7 - z) & 1) ^ invert ? color_on : color_off;
|
|
}
|
|
}
|
|
}
|
|
|
|
EVERY_N_MILLISECONDS(300) {
|
|
invert = !invert;
|
|
}
|
|
}
|