wildbill:
Once you enter the while loop, you never touch cm again so if it's less than 70 at that point, your code will never exit the motor function.
The way to correct that, of course, is to read the sensor again, in the while loop.
wildbill:
Once you enter the while loop, you never touch cm again so if it's less than 70 at that point, your code will never exit the motor function.
The way to correct that, of course, is to read the sensor again, in the while loop.