Dagu Rover Chasis problem

Hi there,

Im totally new in the arduino world, and i can use some help.

I am using a dagu rover chasis connected to a motor shield (2 motor outputs and 2 encoders connected) and i need it to go through a course.

Whenever i try to upload my code which has been attached the rover doesn’t follow the instruction in the code however when i disconnect the usb cable and reconnect it the rover follows the instruction for a single run then the code doesn’t work again. Is this a problem with the encoder or?

Sorry for my bad english, and i hope someone can help me with the code for this project.

Rover_code.txt (3.6 KB)