Looking at the manual it states
Maybe the the pulsein statement is reaching the 65535 counts before the end of the pulse width and thus is setting the value of pulselen to 0 which will always cause the code to jump to the flash led section.If the pulse edge never happens
or the width of the pulse is too great to measure, Var is set to zero.
Bookmarks