Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Heart rate sensor return a value when I'm not wearing my watch

ANSWERED

Hi community,

 

I develop my first clock face and I have my first problem: I display the heart rate on my clockface, but  when I take off my watch, the api return the same last value indefinitely.

 

My code :

 

let hrm = new HeartRateSensor();
hrm.start();

function updateClock(evt) {
  hrLabel.text = hrm.heartRate != null ? hrm.heartRate : "--";
}

clock.ontick = function(evt) {
  updateClock(evt);
}
 

Any solution for that ?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You can use the timestamp to check the age of the last reading.

You can see an example here: https://github.com/Fitbit/sdk-moment/blob/master/app/simple/hrm.js

View best answer in original post

Best Answer
2 REPLIES 2

You can use the timestamp to check the age of the last reading.

You can see an example here: https://github.com/Fitbit/sdk-moment/blob/master/app/simple/hrm.js

Best Answer

Thanks, this repos helps me for a lot of things

Best Answer
0 Votes