PULSIN pin, state, wordvariable
Pin - is a variable/constant which specifies the i/o pin to use.
State - is a variable/constant (0 or 1) which specifies which edge must occur before beginning the measurement in 10us units (at 4MHz resonator).
Wordvariable - receives the result (1-65535). If timeout occurs (0.65536s at 4MHz) the result will be 0.
Measure the length of an input pulse.
The pulsin command makes a pin an input and then measures the length of a pulse on that pin. If no pulse occurs in the timeout period, the result will be 0. If state = 1 then a low to high transition starts the timing, if state = 0 a high to low transition starts the timing. Use the count command to count the number of pulses with a specified time period.
It is normal to use a word variable with this command.
Effect of Increased Clock Speed: