Need Help with IR Sensor Speed Control for Large DC Motor

Why would that code display anything? It is going to run that loop with nothing in it, never calling the speed_calc() function.

Looks like it is working as written to me.