I am currently working on a project which requires me to record IR signals. (I realize there is a library available for doing this but I want to learn how to do this myself).
I tried using a simple sketch which prints out pulseIn()
times on the Arduino, but then if I try to record them into an array, the Arduino misses the pulses happening while it is writing the timings to the array.
How can I achieve being able to record these fast pulses to the Arduino's memory without skipping some of the pulses?
pulseIn
myself because it can block for quite a while until it times out. You could use interrupts or other methods. Try reading the code for IRLib and see the techniques they use. – Nick Gammon♦ Oct 6 '16 at 20:19IRLib.cpp
seems to me to be the bulk of it. – Nick Gammon♦ Oct 6 '16 at 20:32