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
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 ?
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.
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.
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();
}
}