|
STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
|
← STM32duino documentation
|
Pulse width measurement: pulseIn() and pulseInLong(). More...
#include "Arduino.h"Functions | |
| unsigned long | pulseIn (pin_size_t pin, uint8_t state, unsigned long timeout) |
| Measures the length (in microseconds) of a pulse on the pin. | |
| unsigned long | pulseInLong (pin_size_t pin, uint8_t state, unsigned long timeout) |
| Measures the length (in microseconds) of a pulse on the pin. | |
Pulse width measurement: pulseIn() and pulseInLong().
| unsigned long pulseIn | ( | pin_size_t | pin, |
| uint8_t | state, | ||
| unsigned long | timeout | ||
| ) |
Measures the length (in microseconds) of a pulse on the pin.
Works on pulses from 2-3 microseconds to 3 minutes in length, but must be called at least a few dozen microseconds before the start of the pulse.
| pin | Pin number, Dx or x. |
| state | HIGH or LOW, the type of pulse to measure. |
| timeout | Maximum time to wait for the whole measure (end of any previous pulse, start and end of the pulse), in microseconds. Defaults to 1 second when omitted in C++. |
| unsigned long pulseInLong | ( | pin_size_t | pin, |
| uint8_t | state, | ||
| unsigned long | timeout | ||
| ) |
Measures the length (in microseconds) of a pulse on the pin.
Same as pulseIn(); provided for compatibility with the AVR core.
| pin | Pin number, Dx or x. |
| state | HIGH or LOW, the type of pulse to measure. |
| timeout | Maximum time to wait for the whole measure (end of any previous pulse, start and end of the pulse), in microseconds. Defaults to 1 second when omitted in C++. |