Maybe show your test code.
The code sample obviously worked with the full wave, that is it detected the first rising edge, then flipped over to trigger on the falling edge, then set is trigger again on the next rising edge, timing the intervals in between. However, he was interested only in looking at a single wave. You'll have examine a complete stream.
There is another example of input capture in this project, which I wrote sometime ago for identifying sequences of IR pulses, but the logic may be a bit obscured by optimisation measures: Arduino IR Learning Remote Control
1 Like