Wheel encoders on Arduino Uno - half resolution [solved]

Yes Jon, you are right when I looked the serial monitor the values doesn’t match. But if I use greater than or equal to in that condition ,how could I get an exact 90 degree?

Is there any alternate solution to stop both motors individually for 1 second or can you please modify the program which satisfies the both left and right motor condition?

You could probably get both your motors to stop at the right time if you remove delay(1000) from the last two conditionals. If you expect your motors to rotate to 90 degrees at almost the same time, you could just add code to wait for one second after both conditionals occur. Otherwise, if you need more specific timing, you might need to use more advanced programming techniques like using state variables and the millis() function.

-Jon

A post was split to a new topic: Help with encoder on Pololu gearmotor