KY039 Arduino Heart rate code

In the code I think there is error.

You can verify if trasmitter LED ( 5mm round ) lights with you smartphone camera (keep a trasmitter led near camera and if you must see a blue light). If didn't, try to modify code:

void setup ()
{
pinMode (ledPin, OUTPUT);
digitalWrite(ledPin,HIGH); //new line to power on led
Serial.begin (115200);
}

Retry to see led light.
With led on you must read min value.