change how lights tick
This commit is contained in:
parent
1ae28c99c3
commit
caf87bb36d
2 changed files with 4 additions and 3 deletions
5
index.js
5
index.js
|
@ -1,6 +1,7 @@
|
|||
import * as server from './server.js';
|
||||
import * as lights from './lights.js';
|
||||
|
||||
const cfg = JSON.parse(fs.readFileSync('./config.json'));
|
||||
|
||||
server.recv(
|
||||
(res) => {
|
||||
|
@ -11,6 +12,6 @@ server.recv(
|
|||
}
|
||||
);
|
||||
|
||||
while (true) {
|
||||
setInterval(() => {
|
||||
lights.tick();
|
||||
}
|
||||
}, cfg.sleep_time || 500);
|
|
@ -84,7 +84,7 @@ export function tick() {
|
|||
else {
|
||||
ws281x.render(pixels);
|
||||
}
|
||||
ws281x.sleep(cfg.sleep_time || 500);
|
||||
//ws281x.sleep(cfg.sleep_time || 500);
|
||||
}
|
||||
|
||||
function fade(index) {
|
||||
|
|
Loading…
Reference in a new issue