Using Arduino As a Counter

An oscilloscope trace showing the signal you are working with would be worth much more than a thousand words.
Paul