Reading Engine RPM.
eagletalontim
Posts: 1,399
I am looking to read a vehicle's engine RPM which has a 5v square wave output. I have successfully done this with Bean's code on the SX28, but since the propeller is completely different, I was hoping someone may have some code already that I can use for my project.
Comments
Basically, you'd set up one of the counters to count input pulses, wait for a specific period of time, then read (and stop) the counter. How long you'd wait depends on how often you need the RPM reading updated. If you need instantaneous RPM readings, you could also use the cog counters, but measure the time between leading edges of the RPM sensor (to give a time between pulses), then take the inverse of the time to get the frequency.
Look on the page for AN001:
www.parallax.com/tabid/442/Default.aspx
In the Object Exchange, have a look at these. I have no personal experience with them, but they might give you some ideas:
obex.parallax.com/objects/98/
obex.parallax.com/objects/479/