IRremote: how to cler results?


The IR receiver LED blinks everytime it receives a code. So if I keep a button pressed a few seconds, there will be n elements in the results object and that means after processing the first event, it will repeat n-1 times.

Is there any way of getting rid of all those repeat codes after processing the first one? So it would be one keypress-one event.


How do you know that something is a repeat code? You can remember the last received code, and compare following received codes to it. But then you cannot receive two intended transmissions of the same code.

The Results object does not contain multiple elements, only the last received transmission.

Do you get the same code while you keep the button pressed? When I played with an IR remote, it sends a specific code once and next 0xFFFFFFFF (if I recall the value correctly); in that case just ignore the 0xFFFFFFFF.

Else do as DrDiettrich says.