|This page is intended as a reference for core developers only, and the content is only changed after a consensus has been reached through discussion of any such changes. Please use the Discussion page to talk about any changes or issues you have with the current implementation.|
|Classification||Pulse input/output control methods|
|Version introduced||1.0 (0100)|
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout)
The pulseIn() method returns the length in microseconds on a digital input pin for a short period of time from 10 milliseconds to 3 minutes.
Black Box Input
Black Box Output
None. Single signature only.
pulseIn() can be used to read sensors that return a pulse train like some accelerometers or rangers. The user can specify the counting on HIGH or LOW transitions. The pulseIn command stops all activity while executing. A timeout of 1 second (1000000 microseconds) prevents the command to wait forever. A specific timeout in microseconds can also be specified.
For Wiring 1.1
According to Issue 9, pinMode() will be defined as:
void pinMode(pin_t pin, uint8_t value);
See Issue 9 for more details.