IR sensor not showing same values on different remote buttons

Hello, I am a newbie in Arduino. Recently I started learning to use ir sensor for remote control. I made a sketch, where my key values should be sent to serial port, but no matter what buttons I press on the remote it still sends same key codes to serial. I have tried different remotes, three to be exact and see same problem, I also tried different port and different arduino just in case.
Sometimes the remote shows different values, but they quickly become same again.

#include "IRremote.h"

IRrecv irrecv(2); 
decode_results results;

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

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.