IR remote giving same HEX code FFFFFFFF

So I'm new to Arduino and I'm learning about the IR sensor, but whenever I press a button on the remote it always gives me FFFFFFFF.

here is the code

#include <IRremote.h>
int IRpin = 3;
IRrecv IR(IRpin);
decode_results cmd;
  
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
IR.enableIRIn( );
 
}
 
void loop() {
  // put your main code here, to run repeatedly:
while(IR.decode(&cmd) == 0){

}

Serial.println(cmd.value,HEX);
delay(1500);
IR.resume();
}

and please guys give me simple solutions because Im a newbie :slight_smile:

Welcome to the forum

0xFFFFFFFF is usually the code indicating that the button on the remote is being held down so you should get a code for the button followed by a stream of 0xFFFFFFFF if you hold the button down. Is that what you see ?

Welcome to the forum.

Software without context is only half the story. We need to see what hardware you have. Can you post a schematic please of how things are wired up.

hello guys, the problem is fixed, the tutorial that I watched was outdated about 3 years ago, but there is a new problem that happens sometimes, when I press the same button I get a different HEX code, this happens just sometimes

I didn't hold the button, I pressed it, and I know that if the button was held I will get the F's, thankfully the problem is fixed, but now there is a new problem which is that whenever I press the same button I get a different code, and that's for all of the buttons, and all the wires are connected to the right place.

all the wires are in their right place, and I'm using the Elegoo IR remote :slight_smile:

Which is where?

Looks like you are not going to cooperate with us, which is sad because it means we can't help you very much.

You might want to look at this How to get the best from this from this Forum before you proceed any further. And decide if this is the place you want to get help from.

sorry but I'm just new, the wiring are In this order, G is for ground, R is for 5V, and Y is for the digital pin.

Sorry you are misunderstanding, we need to see a schematic not a wiring list.

A wiring list is no good because we have no idea as to what those numbers mean. Nor do we know what the device is that you are wiring up.

Hi, I have the same issue, same code, same hardware. I've swapped out the boards so that's not it.
Mostly getting FFFFFFFF, but not all the time and when I do get a different HEX value from pressing a button this value is not repeated. I'd assume that the same button ought to return the same value with each press. Batteries in IR checked and replaced too.

Help anyone?

Andy

We still need to see a schematic showing how everything is wired up, if you need help.

Hello....


Andy

Not a schematic is it? This is called a photograph.

What is the IR module called?
Have you got a link to it?

......if you can't be polite then don't reply.

OK good bye.

Hi I have the same ptoblem remote it always gives me FFFFFFFF I am following this Toturial
https://www.circuitbasics.com/arduino-ir-remote-receiver-tutorial/#google_vignette
I see besho0 has found the solution but didnt say what it is any help on this would be appreciated.

Hey there, i got the same problem but i got the solution for it!
The tutorial that i was following gave me a code that would always return FFFFFFFF, i dont know why.
I searched for some other tutorials and found this one on youtube that solved my problem!

This is the code:

#include <IRremote.h>

IRrecv IR(7); // Im using the pin 7
decode_results results;

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

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

I hope this help anybody with the same problem.

2 Likes

Thank you so much this helps alot

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