Skip to content

pulseIn() documentation is self-contradictory #706

Open
@ahazybellcord

Description

@ahazybellcord

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions