In a previous post we looked at a method (or algorithm) for decoding the Philips RC-5 protocol with the Arduino. The code was very simple, but not very efficient as it was 'blocking code'.
As a follow up to this, I have written a simple library for the Arduino which can decode RC-5 codes in the background, whilst your main sketch runs un-encumbered in the foreground.
The library can be downloaded here: https://github.com/frodofski/RC5_Decoder
Here is an example of using the library:
The code is very efficient and only uses a small percentage of the Arduino's computing power. This leaves plenty of computing power left for the rest of your sketch to run. One thing to note, is that the library configures timer2 in a way which might conflict with the Tone library, and also may cause problems when trying to use pwm on digital pins 9 and 10.