let nonCircVals = [];
let min = 40000;
let max = -40000;
//circular to non-circular.
for ( let i = 0; i < windowSize; i++ ) {
let v = vals.obj[(tick + 1 + i) % windowSize];
if ( v < min ) min = v;
if ( v > max ) max = v;
nonCircVals.push(v);
}
print(`min is ${min}, max is ${max}`);
//black
require("graph").drawLine(g, nonCircVals,{axes:false,miny:min,maxy:max,gridy:(Math.abs(max-min))/8});
The heartrate.c implementation also applies a band pass filter, which greatly helped before.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
To set constraints of graph with min/max...
The heartrate.c implementation also applies a band pass filter, which greatly helped before.