Skip to content

Commit 8daf499

Browse files
committed
Improve documentation of how pulseInLong()'s timeout works
Previously it was not clear that the function returns after the timeout expires.
1 parent b1613d7 commit 8daf499

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Language/Functions/Advanced IO/pulseInLong.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ subCategories: [ "Advanced I/O" ]
1919
=== Description
2020
`pulseInLong()` is an alternative to link:../pulsein[pulseIn()] which is better at handling long pulse and interrupt affected scenarios.
2121

22-
Reads a pulse (either HIGH or LOW) on a pin. For example, if value is HIGH, `pulseInLong()` waits for the pin to go from `LOW` to `HIGH`, starts timing, then waits for the pin to go `LOW` and stops timing. Returns the length of the pulse in microseconds or 0 if no complete pulse was received within the timeout.
22+
Reads a pulse (either HIGH or LOW) on a pin. For example, if value is HIGH, `pulseInLong()` waits for the pin to go from `LOW` to `HIGH`, starts timing, then waits for the pin to go `LOW` and stops timing. Returns the length of the pulse in microseconds or gives up and returns 0 if no complete pulse was received within the timeout.
2323

2424
The timing of this function has been determined empirically and will probably show errors in shorter pulses. Works on pulses from 10 microseconds to 3 minutes in length. This routine can be used only if interrupts are activated. Furthermore the highest resolution is obtained with large intervals.
2525
[%hardbreaks]

0 commit comments

Comments
 (0)