this project processing happens in the background via Timer 2 interrupt. 2mS sample rate.
1)600 micro seconds? or miliseconds.
volatile int IBI = 600; // holds the time between beats, the Inter-Beat Interval
2)512mV? I assumed
volatile int P =512; // used to find peak in pulse wave