I've just done this exact thing, although I dont know if there's a better way or not.
I bought a 433mHz TX and RX for under £10. Wired a 555 up to the Tx and used different capacitors connected in parallel via switches to alter the 555 freq.
Then I connected a pro mini up to the Rx and used a freq. counter lib that I found. The received freq changed when different buttons were pressed on the Tx.
However because the Tx is constantly transmitting on/off, I found I'd inadvertently created an RF jammer, and with the Tx powered up I couldn't unlock any of the cars on my drive with the remote fobs!
I think something like this would of done the job a lot better, but it doesn't need to be as high powered...
http://proto-pic.co.uk/2km-long-range-rf-link-kits-w-encoder-and-decoder/