You are reading a single comment by @KTibow and its replies. Click here to read the full conversation.
  • I modified the test code a bit, and it seems that the HRM event always gets a higher BPM than the manual counting:

    var M = g.getWidth() / 2;
    var yr, yg, yc, yd;
    let beats = [];
    Bangle.on("HRM-raw", (hrm) => {
      g.scroll(0, 1);
      g.setPixel(M, 0, "#ff0");
      g.setColor(hrm.adjusted ? "#000" : "#0F0").fillRect(
        yg,
        0,
        (yg = hrm.raw / 32),
        0
      );
      g.setColor("#F00").fillRect(yr, 0, (yr = M + hrm.filt / 256 - 30), 0);
      g.setColor("#F0F").fillRect(yc, 0, (yc = M + (hrm.raw - hrm.avg) / 128 + 30), 0);
      if (hrm.isBeat) {
        g.fillRect(yr - 4, 0, yr + 4, 0);
        beats.push(Date.now());
      }
    });
    Bangle.setHRMPower(1);
    Bangle.setLCDTimeout(0);
    Bangle.setLCDPower(1);
    setInterval(() => {
      beats = beats.filter(b => b > Date.now() - 60 * 1000);
      console.log(beats.length, "BPM");
    }, 1000);
    Bangle.on("HRM", (hrm) => console.log("OFFICIAL:", hrm.bpm, "BPM", hrm.confidence));
    

    Any idea why?

About

Avatar for KTibow @KTibow started