Infra Red Delay

I am fairly new to Arduino programming. I want to be able to make an IR controlled car. My IR sensor and all motors work and I have used a decoder program to collect the codes from the buttons: front, left, right. The problem is that in the Serial Monitor, I have the code received printed out on the screen, but at random times, random code symbols (I believe it is machine code) are printed and the motors stop or hesitate. How do I stop that from happening and make the motors move smoothly? Here is the code:

#include <IRremote.h>

//The codes from the remote(pre recorded)
#define forward 16718055
#define right 16734885
#define left 16716015

int IRpin = 11; // infrared reciever pin
IRrecv irrecv(IRpin);
decode_results results;

int leftMotor = 4; //left motor pin
int rightMotor = 5; //right motor pin

long IReceived = 0; //Holds IR data

void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); //Start the receiver
pinMode(leftMotor, OUTPUT);
pinMode(rightMotor, OUTPUT);

}

void loop() {

if (irrecv.decode(&results) == true){ //If a signal is recieved
IReceived = results.value; //Transfer the signal code to a long variable
Serial.print("Received… " + (IReceived));
irrecv.resume(); //Resume IR reading
}
switch (IReceived){
case forward: //If the forward code is received
digitalWrite(rightMotor, HIGH);
digitalWrite(leftMotor, HIGH);
Serial.println(“Forward”);

break;
case right: //If the right code is received
digitalWrite(rightMotor, LOW);
digitalWrite(leftMotor, HIGH);
Serial.println(“Right”);

break;
case left: //If the left code is received
digitalWrite(rightMotor, HIGH);
digitalWrite(leftMotor, LOW);
Serial.println(“Left”);

break;
default: //If any other code is received
digitalWrite(rightMotor, LOW);
digitalWrite(leftMotor, LOW);
}

}

Serial Monitor is usually for debugging. If your code is working, I would comment it out.

The code is working, and I have commented it out, but the motors are still stopping at random times when they're not supposed to. Is it because of the receiver?

Do you use a shared supply for motors and Arduino? Post a diagram. Leo..

What is a shared supply? and do you want just a picture of the breadboard? I'm sorry, I'm really new to Arduino.

Wait... I just hooked up a two led's with resistors in the pins of the motors in the Arduino. Does this mean that there is a problem with the motors?

And the led's didn't turn off at any time.