arduino / arduino/reference-en
pulseIn() documentation is self-contradictory
- Dominant language
- No language data
- Stars
- 173
- Forks
- 704
- PR merge metrics
- No merged PRs in 30d
Description
As it stands, it's impossible to tell the meaning of the "timeout" parameter used in the pulseIn() function. The documentation states that pulseIn()
> Returns the length of the pulse in microseconds or gives up and returns 0 if no complete pulse was received within the timeout.
but later describes the return value as
> The length of the pulse (in microseconds) or 0 if no pulse started before the timeout.
The first statement implies that the timeout may occur any time after calling pulseIn(), even while the pulse is "ON" but hasn't yet turned "OFF". The second statement implies that the timeout may only occur before the pulse has started, so that it shouldn't time out once the pulse is "ON". Both cannot be true.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the pulseIn() reference documentation and the two quoted timeout descriptions. Confirm the intended timeout behavior from the available reference material, then revise the contradictory wording so both descriptions agree and verify that the return-value explanation is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino
- Domain
- documentation, embedded-iot
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100