You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The code I used for that is:

    var M = g.getWidth()/2;
    
    var yr,yg,yc,yd;
    var hrm;
    var n = 0;
    var sps = 0;
    Bangle.on("HRM-raw",h => {
      hrm = h;
      sps++;
      /*if (n=!n) */g.scroll(0,1);
      g.setPixel(M,0,"#ff0");
      g.setColor(hrm.adjusted?"#000":"#0F0").f­illRect(yg, 0,yg=(h.raw/32),0);
      g.setColor("#F00").fillRect(yr, 0,yr=(M + h.filt/256 - 30),0);
      g.setColor("#F0F").fillRect(yc, 0,yc=(M + (h.raw-h.avg)/128 + 30),0);
      if (hrm.isBeat) g.fillRect(yr-4, 0,yr+4,0);  
    });
    Bangle.setHRMPower(1);
    Bangle.setLCDTimeout(0);
    Bangle.setLCDPower(1)
    /*Bangle.on("HRM",h => {
      h.history.sort();
      print(h);
    });*/
    setInterval(function() {
      console.log(sps,"SPS");
      sps=0;
    },1000);
    
    
About

Avatar for Gordon @Gordon started