Ardiuno Nano Pulse sensor and 7 pin OLED 128x64 display

(Novice at arduino) Can anyone help me with my small project, i have worked on the code for awhile now and i have got the code to display a wave form bpm and IBI. But when it runs the 3 outputs are very erratic and cross each others paths as-well as give inconsistent readings, is there anyone out there with any advice or help they can give me ?.

The link to my code is available with this post, to anyone that can help thank you.

Pulse sensor and OLED display.ino (2.7 KB)

Please read the forum guidelines. They will help you to provide information that we need to be able to help you. Post your code as instructed by the guidelines.