I have a project using IR receiver ky 022 and IR remote control. I used the code (IRremote library version 2.6.0) and wiring on the Internet:
#include <IRremote.h>
#define IRPin 2
IRrecv irrecv(IRPin);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value,HEX);
irrecv.resume();
}
}
After uploading the code and press one button, the signal received on Serial Monitor was unstable. For example, when I press the 0 button twice, the first hex signal received was '98AD50CC'; however, the second signal was '13CF8905'.
Someone please gives me a favor and thank you for your help.
6 posts - 5 participants