Question
Counting heart rate over a period of time
Posted on December 03, 2015 at 13:04
Hi all,
I am doing a project to count heart rates. My heart rate device gives a digital output, which I plan to feed into PC2 pin of my STM32f1. My problem though, is calculating the heart rate using this digital input. Here is what I need to do: 1. I need to create a 5 second time period, in which the input is counted when high. 2. I need to then multiply the count with 12 after this 5 second time period to display on the LCD. 3. I will need the 5 second time period to start again, once it finishes. I do know I have to use timers and interrupts to do this, but unfortunately I am using the STM32 for the first time. If someone could help me with a sample code, I would be obliged. Thank in advance.