Learning how to code to make my car do simple moves

i builded a simple car with arduino r3 uno and l289n
the problem is...coding.
i tried to learn to make my mini car go up but it just go around and around although both motor moving
here is the code

int Ain1=2,Ain2=3,Bin1=4,Bin2=5;
void setup() {
    pinMode(Ain1,OUTPUT);
    pinMode(Ain2,OUTPUT);
    pinMode(Bin1,OUTPUT);
    pinMode(Bin2,OUTPUT);
    pinMode(9,OUTPUT);//9 is ENA
    pinMode(10,OUTPUT);//10 is ENB
    delay(2000);
    analogWrite(9,100);
    analogWrite(10,200);
    digitalWrite(Ain1, LOW);
    digitalWrite(Ain2, HIGH);
    digitalWrite(Bin1, LOW);
    digitalWrite(Bin2, HIGH);
    delay(2000);
    analogWrite(9,0);
    analogWrite(10,0);
}

void loop() {
}

i learn coding myself so i would like you guys can help me as much as you guys can, thks

oh and also Ain1, Ain2 is in1,in2
Bin1, Bin2 is in3,in4

Make them both 200 and see what happens.

Look at the motor (that you don't appear to use) library examples. Lots to pick from, the best is a matter of experience and luck. We all started there.

Do you still need help?

oh f im sorry
i found i forgot this post while deleting spams bruh

i will try later cuz i and my friends will have a tutorial how to build a mini arduino car in school (i have tried to build and code it in new year to prepare so i wont be confuse)

thks

No hurry

the same bro

Depending on your definition of "around and around" you have one motor connected backwards or not connected.

[edit]
Here is an L298N steering simulation that might help (you will need to change motor and enable pins). Four basic steering. Six skid steering. Six PWM steering.

oh thks i got it

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.