Combining ECG on oscilloscope to LCD display (SP 5-GFX1 )

My LCD is displaying the graph which is shown on the oscilloscope however the HR: i think what was being measured was the voltage and i cannot come up with a code to calculate the R-R interval so what i need now is the code for R-R interval, that data which will be inputed on my LCD display, i have attached the following code below

LCDisplay-123.ino (13.9 KB)

Please help

Addybnwj:
Please help

What does "HR:" stand for? What is an R-R interval?

R-R interval meaning heartbeat interval highest peak to highest peak. HR is just the name printed on the LCD short form for heart rate

img]A typical ECG signal showing the RR interval.[/img

something like that ^

As a simplistic way of dealing with this. One needs to record continuously the time (millis() ?) when the waveform transitions from below some threshold to above the threshold. This will allow one to compute the time between two or more peaks. But one needs to know what threshold to set so one needs a peak input detection system and use this to define the threshold. Maybe as simple as taking the threshold as half the peak value.

I'm sure there will be better algorithms for this. Ask your professor.

Perhaps an FFT analysis?