01-15-2018 19:21
01-15-2018 19:21
How would I go about capturing the heart BEAT on my custom clock face. I already can get the heart rate, but I would like to add an indicator that flashes with the actual heart beat. Any suggestions?
Thanks,
Phil.
Answered! Go to the Best Answer.
01-17-2018 06:04 - edited 01-17-2018 06:04
01-17-2018 06:04 - edited 01-17-2018 06:04
Whilst it would not be entirely accurate, you could take the current heartrate reading, let's say it comes back as 75bpm. Calculate the interval between beats, (60 * 1000) / 75 = 800 ms.
if (timer already running) clearInterval(timerID)
timerID = setInterval(animationMethod,(60 * 1000) / currentBPM)
Call the above code each time you get an updated heartrate reading. You may have to run animationMethod prior to the setInterval being instantiated.
This may well give you the effect of what you are looking for, albeit each pulse is not generated by an actual heart beat.
I would suspect there would be a "cost" on the battery to be constanly doing the above.
01-16-2018 14:47
01-16-2018 14:47
The API only returns the beats per minute at this time.
01-16-2018 15:21
01-16-2018 15:21
If you're not worried about it matching exactly, you could create an animation that simulates the heart beat based on the BPM.
01-16-2018 23:35 - edited 01-16-2018 23:37
01-16-2018 23:35 - edited 01-16-2018 23:37
Oh no, thats sad. Is there another (maybe not official) way of accessing the hr-sensor data to not get only the computed heartrate back?
I am writing my bachelors thesis and my usecase needs to measure the time between the single beats for arrhythmia.
If there is no way to get the beats... when is the "onreading" event fired? If that would be once it detects a beat or similar (not only by a schedule), i could compute the time between the onreading events..
In the Fitbit App, the Heartbeat tile has the pulsating heart. Is that just an animation based on the bpm?
I'm grasping at straws here.. i chose to work with the fitbit ionic 2 for my bachelor thesis because of the continuous reading from the heartrate sensor. If i can't get the single beats, my app will not work for the medical context it is supposed to get used in.
I'm sorry for hijacking this thread. I was trying to reply to "JonFitbit" directly.
01-16-2018 23:53
01-16-2018 23:53
I think you're out of luck. The callbacks happen at time-based intervals (typically every 5 seconds, but can be 1 second during 'activities'). Fitbits aren't intended for medical contexts.
01-17-2018 06:04 - edited 01-17-2018 06:04
01-17-2018 06:04 - edited 01-17-2018 06:04
Whilst it would not be entirely accurate, you could take the current heartrate reading, let's say it comes back as 75bpm. Calculate the interval between beats, (60 * 1000) / 75 = 800 ms.
if (timer already running) clearInterval(timerID)
timerID = setInterval(animationMethod,(60 * 1000) / currentBPM)
Call the above code each time you get an updated heartrate reading. You may have to run animationMethod prior to the setInterval being instantiated.
This may well give you the effect of what you are looking for, albeit each pulse is not generated by an actual heart beat.
I would suspect there would be a "cost" on the battery to be constanly doing the above.