
Receive IR RC5 commands
-----------------------

infrared receiver (SFH506) on PORTD.2

The routines use external interrupt 0 and timer 0.

If a new IR command is received, the global variable New_IR_Command is set.
It has to be clear by your software.
The received IR command is saved in the global variable IR_Code (int).
The highbyte of IR_Code is the system adress, the lowbyte is the command.

In the header file (ir.h) you can specify the allowed system adresses.
Look for "#define ALLOWED1". The most important system adresses and command
are also predefined.

How to use
----------
Add the ir.c (and ir.h) to your project. Include the ir.h in your source and
call the function 'InitIR()'. This will activate the timer0 and ExtInt0.
It will also enable all interrupts (SEI-command).

Wait for New_IR_Command....



Have fun :-))


The source is programmed for the AVR-Ctrl V1.0

http://www.mikrocontroller.com
mailto:info@mikrocontroller.com