High heart rate values
#8
(05-11-2021, 06:11 AM)Andy--- Wrote: Great, this looks like an adventure, and I love adventures. Lets see how far I get Big Grin

In case of success, how long should the log be?

Good question!

It is a binary file that grows by roughly 500 bytes for every ten seconds the HR monitor program is running (it stores the data every time the BPM field at the top is updated).

It is just a collection of records delimited by header so if you pass the file through a hexdump you should see the header:

0xffff:
YYYY (year, 16-bit)
MMMM (month, 16-bit)
DDDD (day, 16-bit)
hhhh (hour, 16-bit)
mmmm (minute, 16-bit)
ssss (seconds, 16-bit)

Note the header was constructed for convenience of writing rather then efficient packing. Also all those zeros make it easy to resync on the data if we get lost processing it. Anyhow after each header is 480 bytes of raw data (e.g. 240 16-bit samples exactly as they are read from the sensor) except for the first set of samples which could be any length from 1 to 240.

Note that it is impossible to read 0xffff from the sensor so you can just read the raw HR data until you get 0xffff and you will know you just found a new header.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply


Messages In This Thread
High heart rate values - by Andy--- - 04-28-2021, 12:03 AM
RE: High heart rate values - by barray - 04-28-2021, 02:26 AM
RE: High heart rate values - by danielt - 04-28-2021, 04:06 AM
RE: High heart rate values - by danielt - 05-07-2021, 02:15 AM
RE: High heart rate values - by Andy--- - 05-11-2021, 06:11 AM
RE: High heart rate values - by danielt - 05-11-2021, 06:41 AM
RE: High heart rate values - by Andy--- - 04-28-2021, 12:55 PM
RE: High heart rate values - by danielt - 04-29-2021, 03:07 AM
RE: High heart rate values - by wilsonjw - 07-19-2021, 08:19 PM
RE: High heart rate values - by danielt - 07-20-2021, 04:09 AM
RE: High heart rate values - by wilsonjw - 07-20-2021, 08:40 PM
RE: High heart rate values - by danielt - 07-21-2021, 06:21 AM
RE: High heart rate values - by Andy--- - 07-21-2021, 11:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)