Arduino code Problems (Heartbeat Arduino)

Status
Not open for further replies.

imane tech

New Member
Hello Community! I'm facing some problems to understand the code that I want to work with on my project. I found it hard to understand some comments on the code, that I found on Github. In brief, I'm looking forward to doing a simulation of a signal related to my heartbeat sensor. You'll find down below the schematic of the circuit, the code, and the picture of the comment that I didn't understand. Thanks for your help!!



regards, Imane.
 

Attachments

  • code arduino.txt
    4.3 KB · Views: 363
  • HeartRateArduino-master.zip
    5.1 MB · Views: 413
  • comment problem.png
    10.6 KB · Views: 337
Solution

On a quick glance it's a bar meter - the number of LED's lit up signify the heart rate, the more LED's the faster the heart.

On that theme I've just got back from a local 1 mile walk wearing a heart monitor, connected to my walking GPS, min bpm 56, max bpm 95, average bpm 77.
It's hard to tell without looking at the library as pulseSensor.outputSample() is contained within the library.
However, in 20mS at 115,200 (see Serial.begin) baud you can send 115,200/50 bits, so over 2,000 (~200 bytes) each time.
So, I'm also confused by the comment.

Mike.
Edit, maybe, when they wrote that comment, they were running at the default 9600 baud.
 
Last edited:
Thanks for your help!

If you don't mind, I've got another question related to the same code. Basically, my circuit contains 10 LEDs. And those LEDs will light up when the heart bumps. But I don't know how sometimes just half of the LEDs will light up. You'll find down below the part of the code that confused me.



regards, Imane.
 

Attachments

  • LEDS PINS .png
    9.4 KB · Views: 346
  • Hearbeat and leds .png
    23.7 KB · Views: 353
  • light in percentage .png
    13.7 KB · Views: 338
  • HeartRateArduino-master.zip
    5.1 MB · Views: 425
  • code arduino.txt
    4.3 KB · Views: 411

On a quick glance it's a bar meter - the number of LED's lit up signify the heart rate, the more LED's the faster the heart.

On that theme I've just got back from a local 1 mile walk wearing a heart monitor, connected to my walking GPS, min bpm 56, max bpm 95, average bpm 77.
 
Solution
Oh, Thank you so much, Nigel !!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…