Modify a code

#[code]include <AFMotor.h>

AF_DCMotor Motor1(1);
AF_DCMotor Motor2(3);

void setup()
{
}

void loop()
{
Motor1.setSpeed(255);
Motor2.setSpeed(255);
Motor1.run(FORWARD);
Motor2.run(FORWARD);
delay(1000);
Motor1.run(BACKWARD);
Motor2.run(BACKWARD);
delay(1000);
Motor1.run(FORWARD);
Motor2.run(BACKWARD);
delay(1000);
Motor1.run(BACKWARD);
Motor2.run(FORWARD);
delay(1000);
Motor1.setSpeed(0);
Motor2.setSpeed(0);
Motor1.run(BRAKE);
Motor2.run(BRAKE);
delay(1000);
}[/code]

Im making a autonomous car and i found this code on the internet and wanted to know if and how i could modify it so i can make it turn left and right. Im using a motor shield for this btw

Chuck it in the bin and start again

A car that just runs forward and backward is not even a beginning for an autonomous car. A good beginning would be to examine all systems on the car and determine if they are all within parameters and ready to operate, if they need to operate..

Paul

Who made the motor shield you are trying to use? This is Adafruit code you have here. Is it their hardware?

-jim lee