Hello clever people!
The short version:
I'm looking for Input Capture example code or tutorial. I want to measure the time between 2 pulses.
If you have some simple C code you could post, or point me to a tutorial, that would be awesome, thanks!
The long version:
I'm trying to build a tachometer to measure rpm using an infrared sensor. The infra red sensor and circuit has been tested, I can count pulses and display on an LCD.
Now I want to transition from 'counter' to 'tachometer'.
I need to measure the time between falling edges of each incoming pulse. I have never used Input Capture before, so I don't know what to do. I read the ATMEGA16 datasheet, and now my head hurts.
If someone could point me to some (preferably commented) example code (Codevision C / WinAVR C) or a tutorial, it would help me figure out what is going on.