If I do a pulseIn(13,HIGH), and the input happens to be HIGH at the moment, will it start timing immediately? Or will it wait for input to go LOW, the wait for input to go HIGH again, and then start timing? The first choice seems like it would give an invalid result.
The current version of pulseIn waits for any previous pulse to end before starting to measure, but older versions would start timing immediatly if a pulse of the desired level was found when the function was called.