speed control loop for line following Robot
I have found the Kp at the bottom. The problem is that you compute erorL,R in PID() presumably at timed interrupt (flag==1), but then you set everything to zero once returned from PID(). Also you will need some rearangement on number types, you should use floating point math to calculate error, Kp,...then to truncate in integer, then add or subtract. Also a limiting of output value is needed 0-100%.
Not I am not C or C++ programmer so the pseudocode for simple P-regulator is as follows, all numbers are float type:

Y_regulator=(Setpoint-ProcessValue)*Kp + Y_static(Setpoint)
// ProcessValue...your measured value
// Y_static...this is a stored curve, in your case you have set this to 75%
if Y_regulator>100.0 then
  Y_regulator=100.0
elseif Y_regulator&lt;0.0 then
  Y_regulator=0.0
endif  

Then do noramlization, convert 0 to 100% into your registers numbers, by multiplying/dividing , rounding.

Y_Static(Setpoint) can be ommited, but you will need a PI-regulator, anyway with a P-regulator you will never reach the exact velocity, but close enough for the needed application.