chuff014:
I need to read a tachometer in signal from an ECU, one that outputs 5v pulses with a 30% duty cycle as a square wave, which is apparently the standard from what I've seen. I'm pretty sure it's a straightforward case of using a pulse counter, but I need some help with the implementation.
I kind of like using, for this kind of thing a user interrupt pin to detect the raising edge of the signal and in the interrupt ISR use either millis() or micros() to 'timestamp' the signal and set a flag with each new update, then in the main loop calculate the time between the newest reading 'timestamp' and the prior and calculate then convert the time period to RPM units and finally reset the flag.
Lefty