02-20-2018 09:52
02-20-2018 09:52
I am able to grab values from from the HRM with no issue, but now I am looking to reset my displayed value to "--" if the HRM stops picking up new values. Is there a best practice way of doing this?
The only way I can think of doing it is by setting a global variable that increments after every second, and if it reaches >5, set the value to "--", but if the heart rate updates, set it to 0 while updating the on screen heart rate.
Any other suggestions?
Answered! Go to the Best Answer.
02-20-2018 11:29
02-20-2018 11:29
Each sensor reading has a timestamp, I would check the age of the timestamp and use that to determine how stale the reading is.
https://dev.fitbit.com/build/reference/device-api/sensors/#sensorreading
02-20-2018 11:29
02-20-2018 11:29
Each sensor reading has a timestamp, I would check the age of the timestamp and use that to determine how stale the reading is.
https://dev.fitbit.com/build/reference/device-api/sensors/#sensorreading