If the provided source is cut down to the lines that have to do with the temperature, it is just this. If you try this sketch it should behave equally "wrong":
const int sensor = A5;
vout = analogRead(sensor);
tempc = (vout * 500) / 1023;
Why do you compute tempc only after you print out the value in serialOutputWhenBeatHappens`? You also forgot to read the temperature continuously.
Here is how I would do it:
// read the sensor before it is printed on the LCD
vout = analogRead( sensor );
// here I'm not sure what you are computing
// you map the sensor voltage to ...
Most Arduino boards come with a bootloader of some form. This bootloader may do things with IO pins. However apart from that, no, nothing else happens to any IO pins.
The bootloader may:
Flash pin 13 (built in LED)
Configure and communicate on pins 0/1 (UART)
With no bootloader then absolutely nothing happens on any IO pins.