07-25-2018 16:39
07-25-2018 16:39
I'm using what seems to be the standard heart rate code -
hrm.onreading = function() {
if (hrm.timestamp === lastReading) {
myPulse.text = "--";
}
else{
myPulse.text = hrm.heartRate;
}
lastReading = hrm.timestamp;
hrm.stop();
}
On a Versa when the watch is off wrist I would expect the return to be "--" but it looks stuck on the last reading.
09-10-2018 07:58
09-10-2018 07:58
Assuming you called hrm.start() after defining the onreading event handler, I think you just need to move your hrm.stop() call to an unload event handler, something like this:
me.onunload = () => {
saveValues();
hrm.stop();
console.log("We're about to exit");
}
John