Autonomous Robot, motor driver

Yes the code may works perfectl, but it seems to run the motors at 255 which is full speed. When you try to get the wheels to move the robot at full speed immediately, it stalls. But if you do an analogWrite(pin, 10) followed by a short delay and an analogWrite(pin, 20) etc etc it might start moving.

But instead of hard-coding the 10 and 20 etc into a zillion analogWrites, you would increment a variable called speed and have analogWrite(pin, speed) to get it up to speed gradually.