if calFlag = 0 then
goto CalSensor
else
gosub ReadSensor
endif
You could try changing this gosub to a goto ReadSensor.