I am trying to receive an infrared signal using an infrared sensor connected to an Arduino UNO. I have tried out multiple remotes and I only experience this problem with 2 out of the 6 remotes.
When I click a button on one of the remotes I get the button code appearing on-screen and if I hold it down I get FFFFFFFFFF to signify a repeated code, then when I let go of the button the codes stop appearing on the screen (this remote works fine).
But when I use a different remote, when I first press the button I get the button code, and if I continue to hold it down instead of getting FFFFFFFFFF I get the button code again. When I release the button the Arduino continues to display the same button code, the TX light on the Arduino continues to flash as if it is still reading the button code from the infrared receiver but the light on the receiver has stopped flashing to show that there is no code being received. The Arduino continues to show this button code and will not show any other button codes until it is reset
I think I have narrowed the problem down to the way the remote transmits the signal. Using a camera (so I can see the IR signal) the working remotes all pulsate and flicker their code very quickly (i can see this because the IR LED flickers in the camera view while the button is down) but the other remotes constantly emit their codes (the IR LED is constantly on while the button is down).
Because of what I am creating, I need to use one of the remotes that are currently not working so if anyone knows how I can fix this problem it would be greatly appreciated.
Here is my code.
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}