Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Arduino code Problems (Heartbeat Arduino)

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: 57
  • HeartRateArduino-master.zip
    5.1 MB · Views: 65
  • comment problem.png
    comment problem.png
    10.6 KB · Views: 61
Solution
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.

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.

Pommie

Well-Known Member
Most Helpful Member
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:

imane tech

New Member
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.
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
    LEDS PINS .png
    9.4 KB · Views: 63
  • Hearbeat and leds .png
    Hearbeat and leds .png
    23.7 KB · Views: 65
  • light in percentage .png
    light in percentage .png
    13.7 KB · Views: 62
  • HeartRateArduino-master.zip
    5.1 MB · Views: 64
  • code arduino.txt
    4.3 KB · Views: 58

Nigel Goodwin

Super Moderator
Most Helpful Member
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.

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

Latest threads

New Articles From Microcontroller Tips

Top