Heart Rate Monitor not outputting accurate reading

Hi I am passing a heart BPM value from the serial monitor into the Unreal Game Engine. The reading starts high and after several seconds balances out to a value of roughly 58. While this is a possible resting value the issue is that every user who tests the device gets the same reading! Would someone mind taking a look at my code and advise me on what I need to change ?

PulseSensorAmped_Arduino_Leo.ino (4.2 KB)

and advise me on what I need to change ?

The code you posted won't even compile, so that's the first thing you need to fix.

sketch_nov16a.ino: In function 'void setup()': sketch_nov16a:54: error: 'interruptSetup' was not declared in this scope

Hi - I think you need a library sketch included - thats why you are getting errors when you try to compile it. I have attached all of the sketches in the folder. I am using an Arduino Leonardo. The original sketch was for passing details into a processing visualizer however I don’t need to that as I just want to output the BPM to the serial monitor.

PulseSensorAmped_Arduino_Leo.ino (4.2 KB)

AllSerialHandling.ino (2.73 KB)

Interrupt.ino (5.58 KB)

Timer_Interrupt_Notes.ino (6.64 KB)

ISR(TIMER1_COMPA_vect){                         // triggered when Timer1 counts to 124
  cli();                                      // disable interrupts while we do this

Interrupts are ALREADY disabled when an interrupt service routine is called.

      word runningTotal = 0;                  // clear the runningTotal variable

WTF is a word? That’s a stupid invention from the idiots in Redmond.

int fadePin = 13;                  //red  pin to do fancy classy fading blink at each beat

On a Leonardo? Look again.

That code is supposed to be flashing an LED when it detects a heartbeat. Is that happening?

Yes LED4 flashes (the led is on an EMG SpikerShield attached to a leonardo).

Is there any more crap attached to the Arduino that you haven't bothered telling us about?