Tweaked the breathing slightly.

This commit is contained in:
John Shaver 2018-12-12 13:47:14 -08:00
parent dc4d7b5886
commit 67edc68d64

View file

@ -1,6 +1,6 @@
const Gpio = require("pigpio").Gpio; const Gpio = require("pigpio").Gpio;
const schedule = require("./schedule.json"); const schedule = require("./schedule.json");
const HZ = 10000; const HZ = 40000;
let ledRed = new Gpio(18, {mode: Gpio.OUTPUT}); let ledRed = new Gpio(18, {mode: Gpio.OUTPUT});
let ledGreen = new Gpio(12, {mode: Gpio.OUTPUT}); let ledGreen = new Gpio(12, {mode: Gpio.OUTPUT});
@ -51,7 +51,7 @@ let render = setInterval(() => {
}, 50); }, 50);
function getBrightness(x) { function getBrightness(x) {
return Math.floor(breathingCurve(x, 5000, 100000, 1000000)); return Math.floor(breathingCurve(x, 6000, 100000, 1000000));
} }
function breathingCurve(x, interval = 3000, min, max) { function breathingCurve(x, interval = 3000, min, max) {