Do you know what the sample rate is for that raw data array?
I just checked, and it's 50Hz.
Just a note about this though - Espruino includes the raw data array that HRM values are reported into, and they actually continue to be added to the same array - so if you're a little slow processing the array you'll find that the values at the beginning start to change!
If you're doing a lot of processing it could be worth copying the HRM data to a new array first:
var hrmData = new Int8Array();
Bangle.on('HRM', function(hrm) {
hrmData.set(hrm.raw);
// now work with hrmData
);
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That's great - thanks for posting it up!
I just checked, and it's 50Hz.
Just a note about this though - Espruino includes the raw data array that HRM values are reported into, and they actually continue to be added to the same array - so if you're a little slow processing the array you'll find that the values at the beginning start to change!
If you're doing a lot of processing it could be worth copying the HRM data to a new array first: