I'm trying to make an ir beam barrier using ir receiver module. The thing is that I cannot get the code working so that it lights up a led if there is atleast one pulse in 20 ms and a another led if not.
I'm using timer 1 for the 38 kHz pulse generation for the IR-led and the timer is on for 5 ms and off for 15 ms, as the datasheet of the receiver module specifies the acceptable burst (atleast 15 ms gap every 90 ms). No problems there, it works even 5 meters away with a red led connected to the receiver.
But when the receiver module is connected to INT0 and int0 isr just counts up, nothing happens.
I tried just setting a wire from pc.5 to int0 and pulsing the pc.5 5 ms on and 15 off and got nothing.
For the coding I'm using Codevision AVR. What am I doing wrong ? And how do I fix it ?
Simply, I want to light up a led if there is enough pulses in specified time and another led on if there isn't.