The Wiring 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: hbarragan [at] uniandes.edu.co
Name
pulseIn()
Examples
int inpin = 0;
int val = 0;
void setup() {
pinMode(inpin, INPUT);
}
void loop() {
val = pulseIn(inpin, HIGH);
}
Description
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. It 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.