I’ve been experimenting with the infra-red input commands on the PICAXE for some simple remote control Lego robots. There is an official remote control for the PICAXE – in an eye-catching blue case, but for economy I’ve bought a bunch of Poundland universal remote controls.
They don’t give the same hardwearing impression that the official ones give – the cases are a little more flimsy, but they do seem more than adequate to remote control a PICAXE and can therefore add a whole new dimension to PICAXE circuits. An infra-red receiver is an easy thing to add and it means that one input can effectively pretend to be many switches – all present remotely on the handset.
To program the remote, press and hold the TV remote for 5 seconds. The LED will light at this point. Type in the code 0495. When this is completed, the LED will go out and the remote is ready to use.
The command to receive the remote signals is to use:
irin [100],3,b0
Assuming that you’re using input 3. I often use the 08M2 Picaxe, and this is fine. The value is dumped into byte variable b0.
Often I use the following program:
main: irin [100],3,b0 debug goto main
to see the effect of pressing different buttons in the debug window.
I’ve discovered the following codes (File: PoundlandUniversalRemote as a PDF file):