Receiving infrared signals


I want to use infrared waves in my upcoming project, but I have a question: is the arduino capable of reading the infrared's sensor impulses while being occupied with running a different part of the code?

What I mean here is that I have a code, which the arduino runs, and I'm wondering if the arduino can read/store the data incoming from the sensor at any moment - like an interrupt.

Interrupts work only on pins 2 and 3, and luckily pin 3 is PWM capable, which means that I could connect my IR sensor on that pin. But, I am not sure that that pin could read the values incoming from the sensor if it will be used as an interrupt.

Therefore, I am asking for help on how to correctly connect the sensor and write the code so that I won't miss any commands sent by the remote - so that the arduino reacts as soon as possible to the command at every time.

Thank you very much, Mike

Google “arduino ir codes” for example code and projects.