Autonomous Car

const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin

void setup()
{
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);

// set enablePin high so that motor can turn on: ADDED
digitalWrite(enablePin, HIGH);
}
void loop()
{
digitalWrite(motor1Pin, HIGH);
digitalWrite(motor2Pin, LOW);
}

well thats not going to work if you dont have a delay because the pin is switched too fast to make any sense to the motor