autonomous car code

So i have this car and i have to make it run for a certain amount of time to reach a goal. A problem i have is when i plug the car in and start the code it just does dounuts. If someone could look at my code and tell me if it is that it would be appreciated. (im running a motor shield)

const int
PWM_A   = 3,
DIR_A   =12,
BRAKE_A =9,
SNS_A   =A0;

void setup() {
  // Configure the A output
  pinMode (BRAKE_A, OUTPUT);  // Brake pin on channel A
  pinMode (DIR_A, OUTPUT);  // Direction pin on channel A

  // Open Serial communication
  Serial.begin(9600);
  Serial.println("Motor sheild DC motor test:\n");
  // Set the outputs to run the motor forward
    digitalWrite(BRAKE_A, LOW); //setting brake LOW disable motor brake
    digitalWrite(DIR_A, HIGH);  //setting direction to HIGH the motor will spin forward 

    analogWrite(PWM_A,255);     //set the speed of the motor, 255 is the maximum value

    delay(5000);                // hold the motor at full speed for 5 seconds 
    Serial.print("current consumption at full speed: ");
    Serial.println(analogRead(SNS_A));

//Brake the motor

    Serial.println(analogRead(SNS_A));
    //raising the brake pin the motor will stop faster than the stop by inertia
    digitalWrite(BRAKE_A, HIGH);  //raise the brake
    delay(5000);
}

The code turns on one motor. Is that your plan?

The car is an rc car so there is only one motor in the back

So, how does it steer?

Don't you think that might be important for your program?

const int
PWM_A   = 3,
DIR_A   =12,
BRAKE_A =9,
SNS_A   =A0;

Take that page from the Adafruit playbook, fold it until it is all sharp corners, and put it where the sun don't shine.

It is far easier to understand code when there is a little redundancy:

const int PWM_A = 3;
const int DIR_A = 12;
const int BRAKE_A = 9;
const int SNS_A = A0;
//Brake the motor

    Serial.println(analogRead(SNS_A));

That comment is garbage. That is NOT even remotely close to what the code that follows it does.

Of course the code you posted won't even compile, so why the hell did you post an incomplete program? I thought you said you wanted help. It doesn't look like you really do.

The code compiled fine onto the board

cbhunter:
The code compiled fine onto the board

The code you posted did not. The code you posted does not have a loop() function.

core.a(main.cpp.o): In function main': C:\Users\PaulS\Documents\Arduino_105\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to loop'

I'm done asking on this forum. Pretty sure its for answering questions not for making rude comments and asking questions back to other peoples questions. Never have I ever gotten a useful piece of information from this forum. Hell someone even complained about my spelling at one point, really??? what does that have to do with arduinos. forum is ridiculous. All I am is a high school student trying to get this project done so I can help my team advance to the state competition. Im done trying at this point I have no motive to do anymore of these projects because I don't get anywhere with them.

I'm done asking on this forum.

Aw, gee, we'll miss you. No, not really. There are plenty of people willing to post all of their code, and answer questions, to take your place.

PaulS:
Aw, gee, we'll miss you. No, not really. There are plenty of people willing to post all of their code, and answer questions, to take your place.

exactly what I'm talking about

The code as you posted it does NOT compile, it has no loop() as pointed out. You may have a copy / paste gremlin?

If your car has only one motor then either only one back wheel is driven (hence donuts), or there's a mechanism driving both, and perhaps one wheel isn't turning (hence donuts). Or, there's a steering mechanism at the front, like a servo, and you're not controlling it and it's on hard lock (hence donuts).

Don't expcet help if a) your code doesn't compile and or b) you don't describe your hardware setup.

Your original ask was for comments on the code: you got a response that it's only driving one motor. Your response was, well there IS only one motor. At that point, without further input from you, no further help was even possible. (Being told your code as posted has no loop() was a bonus.)