I'm trying to measure inductance with a resonating LC circuit and turning the sinusoidal wave into a square wave with a comparator. I charge the cap and disconnect the 5v, then press down the inductor switch.
Circuit:
http://i54.tinypic.com/2lntzwz.jpg
I don't have an oscilloscope, but it should look like this (comparator on just a signal generator)
http://i55.tinypic.com/30dedma.jpg
Well pulsein(11, HIGH, 500) may return 39us. Now since it's just a resonating circuit, the duty of the square wave is 50%, so 2*39uS is the period. Calculations below show that this isn't correct.

