I am currently building an autonomous robot and need some help getting it to drive exactly where I want it to go using rotary encoders. Can anyone please help me with Arduino code to make two of the gear motors (described above) use the encoder values to travel - for example - 200 counts each and then stop. I am using two Pololu high power motor drivers and an Arduino Mega. I can get it to read values but do not known how to tell the motors to essentially be ‘on’ until they reach a certain encoder value. This is the only way we can get our device to go straight.
Any help is greatly appreciated!