weird fade error

This commit is contained in:
jane 2021-05-26 10:24:57 -04:00
parent 9491782686
commit 82b6d6920c

View file

@ -46,8 +46,14 @@ export function tick() {
var changed = false;
for (let i = 0; i < cfg.leds; i++) {
if (next_pattern[i] != pixels[i]) {
changed = true;
fade(i);
if (next_pattern[i] == pixel_cache[i]) {
console.log("INCONGRUENCE WITH " + i);
pixels[i] = next_pattern[i]
}
else {
changed = true;
fade(i);
}
}
}
if (!changed) {
@ -77,7 +83,6 @@ function fade(index) {
// `interval: ${interval_r} ${interval_g} ${interval_b}\n`)
if (current_tick + 1 >= fade_ticks) {
console.log("FINISHED FADE FOR " + index);
pixels[index] = next_pattern[index];
pixel_cache[index] = next_pattern[index];
}