My end goal is to be able to track my heart rate over time.
I'm looking at soldering a 32k crystal onto my Teensy 3.0 so I can use the RTC, but I noticed it deals in seconds at its lowest resolution. Since heart rate can get up to 3-4 beats per second (at the highest end), I'm going to need a bit higher resolution for logging.
My current line of thinking is to rapidly read the time at start until a second clicks past, call millis() and save the result to use as an offset, then when the heart rate sensor goes off, I can get the current time, and the current millis and do a little math to get the current time down to ms. I know that I'll have to account for millis roll over and such. I recognize that it wont be 100% accurate, but as long as I know generally how far through the second that the heart beat occurred that is good enough.
The only things this chip will be doing is waiting on the hr sensor pin to go high, writing to serial to a data logger, and when I connect to a computer, using serial to dump all the data off of it.
Anyway, is this the best way to deal with this, or are there better solutions?
I'm looking at soldering a 32k crystal onto my Teensy 3.0 so I can use the RTC, but I noticed it deals in seconds at its lowest resolution. Since heart rate can get up to 3-4 beats per second (at the highest end), I'm going to need a bit higher resolution for logging.
My current line of thinking is to rapidly read the time at start until a second clicks past, call millis() and save the result to use as an offset, then when the heart rate sensor goes off, I can get the current time, and the current millis and do a little math to get the current time down to ms. I know that I'll have to account for millis roll over and such. I recognize that it wont be 100% accurate, but as long as I know generally how far through the second that the heart beat occurred that is good enough.
The only things this chip will be doing is waiting on the hr sensor pin to go high, writing to serial to a data logger, and when I connect to a computer, using serial to dump all the data off of it.
Anyway, is this the best way to deal with this, or are there better solutions?