Definition:
Parameters:
| trigger | - | The digital pin index used to trigger the ranger. |
| echo | - | The digital pin index used to read from the ranger. The digital pin must be connected to a pin capable of pulse width timing measurement. |
Return Value:
The raw reading from the SRF05 ranging module in 1.6us increments.
Description:
This routine takes readings from a properly configured Devantech SRF05 Sonar Ranging Module. and reports the time-of-flight for the reading. Mode 1 operation is backwards compatible with the SRF04 ultrasonic rangers. This function is parametrized to allow mulitple rangers to operate on a single BrainStem module. It is recommended to use this function when code size is not critical. When using a single sensor in Mode 1 it is recommended to use the library routines in the aSRF04.tea library.
Example:
intVal = aSRF05Mode1_ReadInt(1,2);
The init (trigger) line is connected to digital pin 1 and the echo line is is connected to digital pin 2. This would take a reading and set intVal equal to the time required for the ping to be received in 1.6us increments (this is round-trip echo return time).
Related:
version: 1.0, build n.a.
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.