Well I think your bit timing interrupt routine is correct as there never seems to be a garbled value sent, just intemittenly a repeat of the last button hit followed by the new button pressed. That is sometimes even when nothing has been pressed for many seconds and you hit a button you get two values, one of the previous button pressed many seconds ago and one value of the new button pressed.
I wonder if this might be some kind of serial communication buffering problem and nothing to do with the IR decode routine? Maybe sometime I'll try the software serial routines instead of the hardware interrupt UART and see if this symptom changes.
I also noticed that if I hold down a button so that the value repeats, I get like 4 values at a constant rate and then there is like a single value 'gap' and then the value repeats again, so 4 values, a one value delay and then 4 values, etc.
Again when I placed a delay of 400 before the print statement I can get real good results, no repeats (unless I hold the button down to long) and never a sign of the prior button value sent when a new button is pressed. With the delay I feel I could use this routine reliably in a application and I thank you very much for sharing it with us. The community grows with every contribution. ![]()
Lefty