kk6682:
I want to print out the period of the signal .which is equal to 1/50.6=0.197
Check your math as that should = 0.0197 seconds, so for one half the period (you are only measuring the positive half of the signal frequency) would be = to .009881 seconds or 9881 usec. So you are measuring about 18% fast which could be just not having an accurate signal generator or possibly noisy zero crossing detection causing an inaccurate 50% duty cycle, and you are only taking a single snap shot measurement rather then say taking a few and averaging them. I played with the pulse in command some a long while back and was not too pleased with it, as I never seemed to get real stable results on a constant frequency input, but never tracked down the cause of the variation even though I was using a good quality signal generator. Possibly millis and micros interrupts could be 'skewing' the results randomly?
LeftyI want to know that is the value of duration equal to the length of the rise time ?
which is equal to half of the period 0.197/2.
Now the displayer just shown as 8117
Is there anything i can convert the value from 8117 to the period