IR sensor giving 0xFFFFFF code only

Hi, I started working on IR sensors recently and I typed up this basic code using the IR_Remote library by shirriff:

const int RECV = 4;
IRrecv irrecv(RECV);
decode_results results;
void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn();

}

void loop() {
  // put your main code here, to run repeatedly:
  if(irrecv.decode(&results)){
    Serial.println(results.value, HEX);
    irrecv.resume();
  }
}

I started pressing buttons on the remote that comes with the starter kit (rexquails), it follows the NEC protocol. for some reason, I only get the code 0xFFFFFFFF for every single button I press. I know that that is the repeat code, but shouldn't there be a different one before the f's start? I am trying to get all of the hex codes for all of the buttons on the remote. Here is it's picture:
image

The library has changed, check the current examples.

I update your example:

#include <IRremote.hpp>

const int RECV = 4;
IRrecv irrecv(RECV);
//decode_results results;  // deprecated

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

void loop() {
  if(irrecv.decode()){
    Serial.println(irrecv.decodedIRData.decodedRawData, HEX);
    irrecv.resume();
  }
}
1 Like

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