weird fade error
This commit is contained in:
parent
9491782686
commit
82b6d6920c
1 changed files with 8 additions and 3 deletions
11
lights.js
11
lights.js
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue