Skip to content

Commit b1613d7

Browse files
committed
Improve the explanation of pulseInLong()'s pulse handling
Previously there was an initial incomplete description of how pulses are handled, followed by a note clarifying how it actually works. Combining all the information into a single statement avoids confusion and makes the documentation less verbose.
1 parent 47fef77 commit b1613d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Language/Functions/Advanced IO/pulseInLong.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ 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 `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 0 if no complete pulse was received within the timeout.
2323

24-
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. Please also note that if the pin is already high when the function is called, it will wait for the pin to go LOW and then HIGH before it starts counting. This routine can be used only if interrupts are activated. Furthermore the highest resolution is obtained with large intervals.
24+
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]
2626

2727

0 commit comments

Comments
 (0)