05-01-2018 16:21
05-01-2018 16:21
Looking for a little help in finding the best way to monitor HR.
Essentially the end result that I am looking for is if the HR is below a defined number, to run a function.
Using an IF statement works, but it only works, but only triggers a single time.
function lowHRDetect() {
let lowHR = (hrm.heartRate);
if (lowHR <= 76) {
doSomething();
}
Using a DO/While statement sends the app into a tizzy and a boot loop.
let lowHR = (hrm.heartRate);
do {
lowHRDetect();
while (lowHR <= 76);
I have tried to get creative and setting up a loop to re-run the function using setTimeout but that sends it into another boot loop.
What is the best practice to trigger the function and then reset it so that it can be used over and over?
Answered! Go to the Best Answer.
Best Answer05-01-2018 23:33
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
05-01-2018 23:33
Best Answer05-01-2018 23:33
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
05-01-2018 23:33
Best Answer