Only one motor is rotating

i have the same line of code for forward and backward as you can see,, but..
when i run my motors using remote, it moves clearly doing what i expect but just for
forward movement,, and for backward movement it only just move 1 motor.. i have pointed where that line is supposedly to work but not.. . could someone explain i can send more info..

my thoughts: the codes are very similar to forward just putting the designated lines to the respected place.. i did it also for backward but only 1 wheel is working..

int Backward()
{

digitalWrite(in1,HIGH);
analogWrite(en1, 65); <----- not rotating..
digitalWrite(in2,LOW);
digitalWrite(in3,HIGH);
analogWrite(en3, 65);
digitalWrite(in4,LOW);
}
int Forward()
{
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(en2, 65);
digitalWrite(in3,LOW);
digitalWrite(in4,HIGH);
analogWrite(en4, 65);
}

pls edit your post, place full code between CODE tags
not forget to show schematic and link to tutorial that you followed
but even so i see too many EN pins. if motor work with en2/en4 you should use it for reverse too, and only IN pins change the state.

thats exactly what im asking for good thing your english is good,, but yeah you said
if motor work with en2/en4 then it should work in reverse only IN pins change sate but that exactly i just did... still not working

Some motors will not operate with a low PWM. Increase your PWM (greater than 65).

What do you see different about your posted code and below? Are you asking for help doing your homework?? Keeping your code organized is very important. You know what you have already is partially working so go back make one motor operate the way you want it to then add in the adittional motors. We need to know a few more things from your code as well such as what pin you are using from what controller.

int Backward()
{
/* motor 1 */
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
analogWrite(en1, 65); 

/* motor 3? */
digitalWrite(in3,HIGH);
digitalWrite(in4,LOW);
analogWrite(en3, 65);
}
int Forward()
{
/* motor 2? */
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(en2, 65);

/* motor 4? */
digitalWrite(in3,LOW);
digitalWrite(in4,HIGH);
analogWrite(en4, 65);
}

pls edit your post, place full code between CODE tags
not forget to show schematic and link to tutorial that you followed

i have 2 motors, it is 2wheels only

digitalWrite(in2,HIGH); <----motor rightside <--- rotating upward
analogWrite(en2, 90); <---- working for acceleration for in2
digitalWrite(in4,HIGH); <------ motor leftside <--- rotating upward
analogWrite(en4,90); <------ working for acceleration for in4

but for backwards
digitalWrite(in1,HIGH); <----motor rightside <--- rotating reverse
analogWrite(en1, 90); <----- not rotating..
digitalWrite(in3,HIGH); <---- motor leftside <---- rotating reverse
analogWrite(en3, 90); <----working

im very confused whyyy its not working im just doing like connecting A to B for upwards but when B to A downwards not working..

going to the left and right works .... the backwards is just not turning that one wheel but if i remove that 2pcs of analogwrite in the line it works but the acceleration is fast so i put analogwrite on both wheels but only got the slow rotation and other completely stops..
hope this bring some idea. thanks for the reply im a student this one is my project.

wait ill post the whole code with picture

#include<IRremote.h>
const int RemotePin=8; <------ what is this
IRrecv irrecv(RemotePin);
decode_results results;

int in1=3;
int in2=5;
int in3=6;
int in4=9;

int en2 = 5;
int en4 = 9;
int en1 = 3;
int en3 = 6;

void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);

}

void loop() {

if(irrecv.decode(&results))
  {
    if (results.value==0xFF629D)//Press UP Button
    { 
      Forward();          
    }
    else if (results.value==0xFFA857)//Press Down Button
    { 
      Backward();
    }
     else if (results.value==0xFF22DD)//Press Left Button
    { 
      Left();
    }
    else if (results.value==0xFFC23D)//Press Right Button
    { 
      Right();
    }
    else if (results.value==0xFF02FD)//Stop
    { 
      Stop();
    }
  irrecv.resume();
}

}

int Backward()
{
digitalWrite(in1,HIGH); //right
analogWrite(en1, 85);
digitalWrite(in2,LOW);
digitalWrite(in3,HIGH); //left
analogWrite(en3, 85);
digitalWrite(in4,LOW);
}
int Forward()
{

digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(en2, 85);
digitalWrite(in3,LOW);
digitalWrite(in4,HIGH);
analogWrite(en4, 85);
}
int Stop()
{
digitalWrite(in1,LOW);
digitalWrite(in2,LOW);
digitalWrite(in3,LOW);
digitalWrite(in4,LOW);
}
int Left()
{
digitalWrite(in1,LOW);
digitalWrite(in2,LOW);
digitalWrite(in3,LOW);
digitalWrite(in4,HIGH);
analogWrite(en4, 80);
}
int Right()
{
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
analogWrite(en2, 80);
digitalWrite(in3,LOW);
digitalWrite(in4,LOW);
}

void Backward(){
  digitalWrite(in2, LOW);
  digitalWrite(in4, LOW);
  digitalWrite(in1, HIGH);
  digitalWrite(in3, HIGH);
  analogWrite(en2, 100);
  analogWrite(en4, 100);
}
void Forward(){
  digitalWrite(in1, LOW);
  digitalWrite(in3, LOW);
  digitalWrite(in2, HIGH);
  digitalWrite(in4, HIGH);
  analogWrite(en2, 65);
  analogWrite(en4, 65);
}

don't know why its still that one wheel not turning, and those analogwrites should be below the specific inputs, if i put that two below it wont work ... it shouldve been but not..

changed to void still that one wheel..

do you have the following in your code?

// Define motor control pins
const int in1 = 2;
const int in2 = 3;
const int in3 = 4;
const int in4 = 5;
const int en1 = 6;
const int en2 = 7;
const int en3 = 8;
const int en4 = 9;

  // Set all motor control pins as outputs
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  pinMode(en1, OUTPUT);
  pinMode(en2, OUTPUT);
  pinMode(en3, OUTPUT);
  pinMode(en4, OUTPUT);
  
  // Initialize all motors to be off
  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);
  digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);
  analogWrite(en1, 0);
  analogWrite(en2, 0);
  analogWrite(en3, 0);
  analogWrite(en4, 0);

shouldn't there be 6 separate pins: EN1, EN2, IN1, IN2, IN3 and IN4. Each motor controlled by 2 IN pins and 1 EN pin

and as Delta_G said, a separate pin for the IR receiver

i wonder why it works at all

this is the diagram i copied (this has 4 motors but im only using 2)

then again when going backward,, only one wheel is rotating after putting analogwrite ..
but when there is no analogwrite written the two wheel works..

the driver board you're using has only 4 control pins: ENA, IN1/IN2, IN3/IN4, ENB.

IN1/IN2 controls the direction when LOW/HIGH. You need to define only in1, in3, en1 and en2 to match the connections to the board

L298N-Motor-Driver-Module-Pinout

your code would be

int Backward()
{
    digitalWrite(in1,HIGH); //right
    analogWrite(en1, 85);

    digitalWrite(in3,HIGH); //left
    analogWrite(en3, 85);
}

I´m not that sure 2xAA batteries (3V) will be enough to power this setup...

in1 connected to pin 3
in2 connected to pin 5
in3 connected to pin 6
in4 connected to pin 9 (pin is the arduino)

so going back.. my code for backward is.
void Backward()
{
digitalWrite(in1,HIGH);
analogWrite(en1, 85); <--- can be also (in1, 85)
digitalWrite(in3,HIGH);
analogWrite(en3, 85); <--- can be also (in3, 85)
}

but still one motor moves.. removing the analog write works but the speed is not adjusted and going too fast, so if theres another alternative to analog write that would be great

i want to know why isnt it working, i literraly copied the code gcjr: posted
and its the same as what my code is..

int Backward()
{
digitalWrite(in1,HIGH);
analogWrite(en1, 85);
digitalWrite(in3,HIGH);
analogWrite(en3, 85);
}

i copied also all the diagram connection in to pin which is working.. but when the code is writted for motorspeed like analaogwrite(en1 for (in1), 85) it is not rotating.. but the other wheel as you can see in the code of (en3 for(in3) ,85) is rotating and acceleration is right .