Help Needed with IR Controlled Joystick Car Project

Hello,

I am doing a project in which I control a two DC motor car with an L298n motor driver through an IR receiver joystick remote. I am using two 12 volt DC motors, a 38kHz IR Reciver Module along with an IR LED, and an arduino joystick. My code uploads properly but when I toggle the joystick, the motors do not respond. However, I am getting the correct feedback in my serial monitor. I have attached both the joystick remote code and the car code along with my schematic.

// JOYSTICK REMOTE CODE

#include<IRremote.h>  
IRsend irsend;
void setup() {
  // put your setup code here, to run once:
pinMode(A0,INPUT);
pinMode(A1,INPUT);
pinMode(A2,INPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
int x= map(analogRead(A0),0,1023,0,10);
int y= map(analogRead(A1),0,1023,0,10);
//int z= map(analogRead(A2),0,1023,0,10);
//Serial.print(String(x)+"  "+String(y)+"  "+String(z)+"\n");
if(x==0 && y==5)
{
   irsend.sendNEC(0x80BF53AC,32);//up    the 80BF53AC is just a HEX code
}
else if(x==10 && y==5)
{
    irsend.sendNEC(0x80BF4BB4,32);//dwn
}
else if(x==5 && y==0)
{
   irsend.sendNEC(0x80BF9966,32);
}
else if(x==5 && y==10)
{
  irsend.sendNEC(0x80BF837C,32);
}
else
{
  irsend.sendNEC(0x70CA9977,32);
}
delay(500);
}



// CAR CODE

#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
  // put your setup code here, to run once:
pinMode(10,OUTPUT);
pinMode(9,OUTPUT);
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
Serial.begin(9600);

 irrecv.enableIRIn();
}

void loop() {
  // put your main code here, to run repeatedly:
   if (irrecv.decode(&results)) {
    unsigned long x=results.value;
    irrecv.resume(); // Receive the next value
    Serial.println(x);
    if(x==2160022444)//forward      2160022444 is just the decimal value of the hex number 80BF53AC
       {
      digitalWrite(10,HIGH);
      digitalWrite(9,LOW );
      digitalWrite(12,LOW );
      digitalWrite(13,HIGH );
       }
      else if(x==2160020404)//backward
      {
      digitalWrite(10,LOW);
      digitalWrite(9,HIGH );
      digitalWrite(12,HIGH );
      digitalWrite(13,LOW );}
  
      else if(x==2160034684)//right
      {
       digitalWrite(10,LOW );
      digitalWrite(9,LOW);
      digitalWrite(12,LOW );
      digitalWrite(13,HIGH);       
      }
      else if(x==2160040294)//left
      {
       digitalWrite(10,HIGH );
      digitalWrite(9,LOW);
      digitalWrite(12,LOW );
      digitalWrite(13,LOW);
      }
        else //stop      at any other joy position the car will stop
      {
      digitalWrite(10,LOW );
      digitalWrite(9,LOW);
      digitalWrite(12,LOW );
      digitalWrite(13,LOW);
      }
      }

Here is the image of the schematic

I cannot identify the components and pins in your picture. Please create a circuit diagram.

You want to control the car by both its own IR remote control, and by your Arduino, right?

If you receive exactly the right signals, something seems to be wrong with the motors. I’d put at least a “stop!” message into the motor stop code, best a message into all selections.