Re: Turning using encoders
The robot will know how far to turn using the encoder values, just as if it was going straight. Take a look at the code below:
The condition inside of our while loop is motorB reaching an encoder count of 150. As long as that condition is correct,
the robot will make a point turn left. As soon as the condition is no longer true, the loop breaks and the robot moves forward.
The robot moves proportionally, so if at an encoder count of 150, the robot makes a 45 degree turn, you can double your encoder
value and it should make a 90 degree turn. Experiment with it, and see what happens.