Heart Rate Sensor : No Output from the code

I am working on my Heart rate monitor project using a heart rate sensor module which gives Digital output. I have connected its output pin to pin 0, and the VCC and ground pins to their respective pins of the bolt wifi module and have used the following code to execute it.
However, when I run this code, there is no output and I have to use ^C to exit the execution. No error messages either. Can anybody let me know what is the error in the code?Inkedcode_LI

@csadiya.444
I Think you should connect your output to the A0 pin as it is a sensor it will not provide you any digital signal.
and your code was running can you tell why there is 2 while block.
Elaborate your requirement precisely.

As I mentioned I am using a heart rate sensor module : It has on chip A-D converter and hence is providing me Digital output. I tweaked my code a bit and added some test prints. The values of ‘pulse’ and ‘lastPulse’ are changing as required, however now the execution is not entering the second IF loop. I tried changing the “HIGH” to 1/“1” but to no avail.1 ![2|321x500]

test1 and test2 are giving results as expected
test3 and test4 are not being executed
test5 gives me an output of 0. i.e. the initialized value of highCounter


This is the terminal output

@csadiya.444 let me refer this to Rahul sir @rahul.singh1 he will figure out the what to do as i am unable to rectify the error.

1 Like

@rahul.singh1
Sir Please help this out as I am unable to rectify the error.

1 Like

@csadiya.444
What are your exact objectives for this project?
test3 and test4 aren’t working simply because the reading of pulse never becomes 1/HIGH

@nazirahammed98 @abishrant.dey Thanks a ton ! The error has now been rectified.

2 Likes

Hi @nazirahammed98,

Apology , I missed to answer this query.

Do let me know in case you still need any help for this error.

@csadiya.444 can you send your rectified code, I want to see it please

Here is the code that worked


Hope it helps!