First try with interrupts. Reading period time of squarewave generator at pin 8 (ICP1)
Doesnt seem to work, outputs random numbers.
Input freq = 1000 Hz 5Vt, result should be app. 2000. Why not.
haven't look at the code, but interrupts variables that are used within the main code need to be volatile (and you'd be better off making a copy within a protected section in the loop before printing them)
--
Please correct your post above and add code tags around your code: [code]`` [color=blue]// your code is here[/color] ``[/code].
It should look like this:// your code is here
(Also press ctrl-T (PC) or cmd-T (Mac) in the IDE before copying to indent your code properly)