Project with Arduino fail to work

I have been working on a remote control car project but it failed ,i don't know what exactly is wrong with it .I am using the Arduino uno,h bridge motor driver l298n, tsop ir receiver,12v DC motor,and 9+9volt battery.the code for car is -->

#include <IRremote.h>
const int REC_PIN = 4;
IRrecv irrecv(REC_PIN);
decode_results results;
int in1 = 6;//MOTOR A(LEFT)
int in2 = 7;
int ENA = 3;

int in3 = 8;//MOTOR B(RIGHT)
int in4 = 9;
int ENB = 5;
// All Stop
void allStop() {
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
analogWrite(ENA, 0);
analogWrite(ENB, 0);
}

void allForward() {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
analogWrite(ENA, 255);
analogWrite(ENB, 255);
}
void allForwardHalf() {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
analogWrite(ENA, 127);
analogWrite(ENB, 127);
}

void allReverse() {
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
analogWrite(ENA, 255);
analogWrite(ENB, 255);
}
void allReverseHalf() {
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
analogWrite(ENA, 127);
analogWrite(ENB, 127);
}

void skidsteerLeft() {
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
analogWrite(ENA, 255);
analogWrite(ENB, 255);
}

void skidsteerRight() {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
analogWrite(ENA, 255);
analogWrite(ENB, 255);
}

void setup() {
// put your setup code here, to run once:
pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(ENA,OUTPUT);
pinMode(in3,OUTPUT);
pinMode(in4,OUTPUT);
pinMode(ENB,OUTPUT);
irrecv.enableIRIn();
irrecv.blink13(true);

}

void loop() {
// put your main code here, to run repeatedly:
if (irrecv.decode(&results)){

switch(results.value){
case 0xFFA25D:
Serial.println("CH-");
break;
case 0xFF629D:
Serial.println("CH");
break;
case 0xFFE21D:
Serial.println("CH+");
break;
case 0xFF22DD:
Serial.println("|<<");

I am thinking d connections are wrong or something

Please provide a detailed description of what you mean by "it failed".

Please post your full sketch (what you posted above is incomplete). If possible, you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link.

Please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

webcrawler:
I am thinking d connections are wrong or something

I am thinking the code you posted shows that you have lots of functions that might do something with the motors. But in your main loop() you never use any of them. So that's one good reason why the car isn't going anywhere. Perhaps your complete program contains some more useful code?

Also some details of EXACTLY what motors, motor driver(s) and batteries you are using might help. And you're right connections could be a problem so why don't you post a circuit diagram which shows your connections?

Steve

Here is the code help me check if I have written a wrong code

#include <IRremote.h>
const int REC_PIN = 4;
IRrecv irrecv(REC_PIN);
decode_results results;
int in1 = 6;//MOTOR A(LEFT)
int in2 = 7;
int ENA = 3;


int in3 = 8;//MOTOR B(RIGHT)
int in4 = 9;
int ENB = 5;
// All Stop
void allStop() {
  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);
  digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);
  analogWrite(ENA, 0);
  analogWrite(ENB, 0);
}
 
void allForward() {
  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
}
void allForwardHalf() {
  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  analogWrite(ENA, 127);
  analogWrite(ENB, 127);
}
 
 
void allReverse() {
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH);
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
}
void allReverseHalf() {
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH);
  analogWrite(ENA, 127);
  analogWrite(ENB, 127);
}
 
void skidsteerLeft() {
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
}
 
void skidsteerRight() {
  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH);
  analogWrite(ENA, 255);
  analogWrite(ENB, 255);
}
 
void setup() {
  // put your setup code here, to run once:
  pinMode(in1,OUTPUT);
  pinMode(in2,OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(in3,OUTPUT);
  pinMode(in4,OUTPUT);
  pinMode(ENB,OUTPUT);
irrecv.enableIRIn();
irrecv.blink13(true);

}

void loop() {
  // put your main code here, to run repeatedly:
    if (irrecv.decode(&results)){
 
        switch(results.value){
          case 0xFFA25D:
          Serial.println("CH-");
          break;
           case 0xFF629D:
          Serial.println("CH");
          break;
          case 0xFFE21D:
          Serial.println("CH+");
          break;
          case 0xFF22DD:
          Serial.println("|<<");
          break;
          case 0xFF02FD:
          Serial.println(">>|");
          break ;  
          case 0xFFC23D:
          Serial.println(">||");
          break ;                   
          case 0xFFE01F:
          Serial.println("-");
          break ;  
          case 0xFFA857:
          Serial.println("+");
          break ;  
          case 0xFF906F:
          Serial.println("EQ");
          break ;  
          case 0xFF6897:
          Serial.println("0");
          break ;  
          case 0xFF9867:
          Serial.println("100+");
          break ;
          case 0xFFB04F:
          Serial.println("200+");
          break ;
          case 0xFF30CF:
          Serial.println("1");
          allStop();
          break ;
          case 0xFF18E7:
          Serial.println("2");
          allForward();
          break ;
          case 0xFF7A85:
          Serial.println("3");
          allForwardHalf();
          break ;
          case 0xFF10EF:
          Serial.println("4");
          allReverse();
          break ;
          case 0xFF38C7:
          Serial.println("5");
          allReverseHalf();
          break ;
          case 0xFF5AA5:
          Serial.println("6");
          skidsteerLeft();
          break ;
          case 0xFF42BD:
          Serial.println("7");
          skidsteerRight();
          break ;
          case 0xFF4AB5:
          Serial.println("8");
          break ;
          case 0xFF52AD:
          Serial.println("9");
          break ;      
        }
        irrecv.resume(); 
  }

What does it do? What do all your Serial.println()s show? E.g. do they show that you are ever calling the motor functions? If you write a simple program without all the IR stuff that just moves forward for 2 seconds, backwards for 2 seconds then stops does that work?

I still can't see a circuit diagram or any details of the battery, motors etc.

Steve

I don't know if u could help me write a code for a remote control car using infrared receiver and ultrasonic sensor with Motor driver controlling 4 motors .the car shud be able to move forward ,backward ,right ,left .for Arduino pinmode use any I would connect it .I find it difficult to write the code for my project because it my first.

This is the hex code for my remote

switch(results.value){
         case 0xFFA25D:
         Serial.println("CH-");
         break;
          case 0xFF629D:
         Serial.println("CH");
         break;
         case 0xFFE21D:
         Serial.println("CH+");
         break;
         case 0xFF22DD:
         Serial.println("|<<");
         break;
         case 0xFF02FD:
         Serial.println(">>|");
         break ;  
         case 0xFFC23D:
         Serial.println(">||");
         break ;                   
         case 0xFFE01F:
         Serial.println("-");
         break ;  
         case 0xFFA857:
         Serial.println("+");
         break ;  
         case 0xFF906F:
         Serial.println("EQ");
         break ;  
         case 0xFF6897:
         Serial.println("0");
         break ;  
         case 0xFF9867:
         Serial.println("100+");
         break ;
         case 0xFFB04F:
         Serial.println("200+");
         break ;
         case 0xFF30CF:
         Serial.println("1");
         allStop();
         break ;
         case 0xFF18E7:
         Serial.println("2");
         allForward();
         break ;
         case 0xFF7A85:
         Serial.println("3");
         allForwardHalf();
         break ;
         case 0xFF10EF:
         Serial.println("4");
         allReverse();
         break ;
         case 0xFF38C7:
         Serial.println("5");
         allReverseHalf();
         break ;
         case 0xFF5AA5:
         Serial.println("6");
         skidsteerLeft();
         break ;
         case 0xFF42BD:
         Serial.println("7");
         skidsteerRight();
         break ;
         case 0xFF4AB5:
         Serial.println("8");
         break ;
         case 0xFF52AD:
         Serial.println("9");
         break ;

I would be so happy if u could help me with my first project by helping write the code

If you ever answer the many questions people have asked or do anything with the suggestions you've already received then you might get some more help. But so far you are simply ignoring anything that we say. That's not the way you encourage people to help you.

If you just want someone to write your code for you then try the Gigs and Collaborations forum and be prepared to pay for it.

Steve