Problems with Rotation sensor

I have been having problems with using the rotation sensor to make motors stop spinning when it reaches a certain point. This is an example of my code.


This is what you probably want to do, you need to slow the motor down before it reaches your target position proportionally. Motors/the robot have momentum and won’t magically stop and stand still after you stop applying voltage to it.

1 Like

You need to add Lift.stop(); right after the while loop. Otherwise, it doesn’t know that you don’t want it to keep going anymore.