Hi, I've set up a breadboard with an IR emitter and receiver, and I'm trying to emit and receive certain pulse durations. The emission works fine, but I'm unable to receive more than illogical values from trying to read pulseIn durations. Can anyone see anything wrong in the code / how can I fix this?
Clarification: I'm using an external remote to test the receiver, not the LED
My Circuit ( the power source is the PC it's plugged into):
Best read the posting requirements here at the head of this forum.
Think you will do better if you copy your code from your iDE using the code brackets and pasting here.
A circuit diagram would help as well as details on any parts used and include details of power supply.
yeah, transmitting light, then trying to receive it..
gonna need a faster board, faster than speed of light..
maybe a dual core running concurrent threads..
sorry.. ~q
Thanks for the response,
I've been testing with a handheld remote, and the receiver seems to read nothing still. The only times I do get some values are extremely random, and I can't connect it to anything logical
You have a problem with the processor, it cannot do two things concurrently. It can transmit or receive but not both at the same time. You make this more problematic by using delay();
Hopefully you are using devices that both use a 38kHz off-on IR signal. So your ON signal needs to be at least three of the IR signal off-on rate in order to actually modulate the 38kHz signal for your receiver to sense. You figure the delay needed.