Skip to content

pulseIn documentation is misleading #7664

Closed
@davidje13

Description

@davidje13

The pulseIn documentation claims:

Gives up and returns 0 if no pulse starts within a specified time out.

https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/

While pulseInLong states:

Returns the length of the pulse in microseconds or 0 if no complete pulse was received within the timeout.

https://www.arduino.cc/reference/en/language/functions/advanced-io/pulseinlong/

Looking at the code and this pull request, it is clear that pulseInLong describes the correct behaviour for both functions (i.e. the timeout specified is for the pulse to start and end).


Additionally neither page documents that the functions will wait for any existing pulse to end then measure the next pulse (e.g. if measuring a HIGH pulse while the pin is already HIGH, it will wait for LOW, HIGH, LOW; rather than just LOW).

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