Compare commits

..

1 commit

Author SHA1 Message Date
af4c156055 add slide function 2021-10-08 01:02:56 -04:00

View file

@ -9,7 +9,6 @@ const log = new Logger(
); );
const fade_ticks = cfg.fade_ticks || 20; const fade_ticks = cfg.fade_ticks || 20;
var num_ticks = 0;
var pixels = new Uint32Array(cfg.leds); var pixels = new Uint32Array(cfg.leds);
var pixel_cache = new Uint32Array(cfg.leds); var pixel_cache = new Uint32Array(cfg.leds);
var next_pattern = new Uint32Array(cfg.leds); var next_pattern = new Uint32Array(cfg.leds);
@ -114,25 +113,15 @@ export const functions = {
convert_args: true, convert_args: true,
} }
), ),
stagger: new Function( slide: new Function(
(index, arg1, arg2) => { (index, arg1, arg2) => {
return (index + arg2) % 255; return index + arg2;
}, },
{ {
requires_arg1: true, requires_arg1: true,
requires_arg2: true, requires_arg2: true,
convert_args: true, convert_args: true,
}, }
slide: new Function(
(index, arg1, arg2) => {
return (num_ticks + arg2) % 255;
},
{
requires_arg1: true,
requires_arg2: true,
convert_args: true
}
)
), ),
}; };
@ -182,7 +171,6 @@ function tick_pattern() {
} else { } else {
getRandom(); getRandom();
} }
num_ticks++;
} }
function getRandom() { function getRandom() {