Mirror of espurna firmware for wireless switches and more
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
766 B

#if GARLAND_SUPPORT
#include "../anim.h"
#include "../color.h"
#include "../palette.h"
#include "color_wave.h"
//------------------------------------------------------------------------------
class AnimRun : public Anim {
public:
AnimRun() : Anim("Run") {
}
void SetupImpl() override {
unsigned int waveLen = secureRandom(10, 30);
bool cleanColors = secureRandom(10) > 7;
byte fade = palette->bright() ? secureRandom(180, 220) : 0;
wave = ColorWave(numLeds, palette, waveLen, cleanColors, fade, ledstmp);
}
void Run() override {
for (auto i = 0; i < numLeds; ++i) {
leds[i] = wave.getLedColor(i);
}
wave.move();
}
ColorWave wave;
};
#endif // GARLAND_SUPPORT