in the for loop, linear movement is performed so that it does not stop at every point of the loop, but continues with C_DIS :
Is it possible to use an interrupt or some other method to monitor the value of the input, without stopping the robot, and without losing continuity?
It is only necessary to monitor if there is a change in the input in order to use that information later