I’m not sure whether this code has a home now, but I know it was a real life-saver when a student of mine needed it for a project this time last year, so I’m putting a copy up for download here: rc5xmit.zip.
If you want to use this code with a Lilypad, or another Arduino that doesn’t use a 16MHz processor clock, then you need to change the setting in the irparams.h header file:
#define SYSCLOCK 16000000 // main system clock (Hz)
For example, for an 8MHz Lilypad…
#define SYSCLOCK 8000000 // main system clock (Hz)