I'm using a standard 38kHz receiver with Arduino-IRremote library and it works fine for a while but then it stops working. The loop function is running time after time as expected but at some point the library decode function starts returning false until I reset the board.
This example code works for me with any arduino nano or bare atmega328p at 8Mhz but for both of them it freezes after some receptions.
The code is the library example itself:
#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
}
delay(100);
}
Some times this happens fast and other times it is after 20 or more receptions. I only added a led blink later to test if the board is frozen or is only the infrared that stops receiving and it was the second case.