Experiment in getting the differing delays in Single/MultiDynamic effects to work. Unsuccessful, for now.
This commit is contained in:
@ -2,7 +2,11 @@
|
||||
#include "effect_single_dynamic.h"
|
||||
#include "config.h"
|
||||
|
||||
int MultiDynamicEffect::getLoopTime() { return EFFECT_MULTI_DYNAMIC_LOOP_TIME; }
|
||||
MultiDynamicEffect::MultiDynamicEffect() {
|
||||
init();
|
||||
loopTime = EFFECT_MULTI_DYNAMIC_LOOP_TIME;
|
||||
}
|
||||
|
||||
void MultiDynamicEffect::update() {
|
||||
for (int i=0; i<tile_count; i++) tiles[i] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
|
@ -2,17 +2,22 @@
|
||||
#include "functions.h"
|
||||
|
||||
SingleDynamicEffect::SingleDynamicEffect() {
|
||||
init();
|
||||
loopTime = EFFECT_SINGLE_DYNAMIC_LOOP_TIME;
|
||||
}
|
||||
|
||||
void SingleDynamicEffect::init() {
|
||||
for (int i=0; i<tile_count; i++) tiles[i] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
int SingleDynamicEffect::getLoopTime() {
|
||||
return EFFECT_SINGLE_DYNAMIC_LOOP_TIME;
|
||||
}
|
||||
|
||||
void SingleDynamicEffect::update() {
|
||||
tiles[random8(tile_count)] = CHSV(baseHue + random8(64), 180, 255);
|
||||
}
|
||||
|
||||
boolean SingleDynamicEffect::can_be_shown_with_clock() { return true; }
|
||||
|
||||
void SingleDynamicEffect::loop() {
|
||||
EVERY_N_MILLISECONDS(getLoopTime()) {
|
||||
/*EVERY_N_MILLISECONDS(loopTime) {
|
||||
memcpy(old_tiles, tiles, tile_count*sizeof(CRGB));
|
||||
blend = 0;
|
||||
update();
|
||||
@ -22,5 +27,12 @@ void SingleDynamicEffect::loop() {
|
||||
int index = y/2 * window.w/2 + x/2;
|
||||
setPixel(window, x, y, nblend(old_tiles[index], tiles[index], blend));
|
||||
}
|
||||
if (blend < 255) blend+=20;
|
||||
if (blend < 255) blend+=20;*/
|
||||
EVERY_N_MILLISECONDS(loopTime) {
|
||||
update();
|
||||
}
|
||||
for (int x=0; x<window.w; x++) for (int y=0; y<window.h; y++) {
|
||||
int index = y/2 * window.w/2 + x/2;
|
||||
setPixel(window, x, y, tiles[index]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user