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

Heartbeat on Clock Face

ANSWERED

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.

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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.

View best answer in original post

Best Answer
0 Votes
5 REPLIES 5

The API only returns the beats per minute at this time.

Best Answer
0 Votes

If you're not worried about it matching exactly, you could create an animation that simulates the heart beat based on the BPM.

Best Answer
0 Votes

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. 

Best Answer
0 Votes

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.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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.

Best Answer
0 Votes