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