IR Remote Controller and IR receiver

Hi Everyone

I tried to setup an IR remote and receiver on an Arduino. I've followed the following website as tutorial. The problem is when I've tried the following codes to find the HEX code of each button.

#include <IRremote.h>

const int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
  Serial.begin(9600);
  irrecv.enableIRIn();
  irrecv.blink13(true);
}

void loop(){
  if (irrecv.decode(&results)){
        Serial.println(results.value, HEX);
        irrecv.resume();
  }
}

The problem is that I have to press two or three times to get the correct HEX code of the corresponding button as shown in the figure.

I also upload the image of the IR remote that I have used.

Is there any problem in the code or I have to use another IR receiver?

Any help is appreciated.
Many thanks.
Mahdiyar

I'm missing the links to the used hardware and the wiring diagram.

The kind of remote you're using are mostly sending in NEC protocol, so hinting the IRremote library about that information may help to get better readings.

pylon:
I'm missing the links to the used hardware and the wiring diagram.

The kind of remote you're using are mostly sending in NEC protocol, so hinting the IRremote library about that information may help to get better readings.

Dear Pylon,
Thank you for your reply. I have attached the schematic that I have used. I went through the "IRremote.h" file and set only "NEC" Protocol to 1, in order to consider that protocol. But, still I've faced with the same problem.

I've changed the IR Remote Control and used a TV Remote. It work much better.