The timing of this function has been determined empirically and will probably show errors in longer pulses. Works on pulses from 10 microseconds to 3 minutes in length.
what will happen if pulse get high and do not be low for long time ?
[u]pulseIn()[/u] says you can go up to 3 minutes, or you can set a timeout. (But, you'll need a type long to hold more than 65,535 microseconds. ).
i want to measure 50khz to 200khz ! and this part shouldnt take time more than 5ms !
If my math is correct, the period of a 50kHz square wave is 0.02mS so that's the longest it can take to "measure" (excluding any processing/calculating or I/O, etc.). In any case, it will NEVER be 5ms if the minimum frequency is 50kHz.
i will sampling result every 100ms but the time it take to measure frequency shouldnt be more than 5 ms !( some times frequency is much lower than 50khz ! i dont need them !
if for example frequency = 10hz it at least take 100ms to measure !! but it shouldnt take that much time !
(i do not need to measure frequency lower than 50khz !