Definition:
Parameters:
| rangerAddress | - | The I2C address of the ranger to be read. |
| unitCode | - | The unit code for the return value. There are three valid codes: aSRF08_INCH (inches) aSRF08_CM (centimeters) aSRF08_MS (milliseconds) |
Return Value:
The reading from the addressed SRF08 ranger with the specified units.
Description:
This routine takes a single reading from the Devantech SRF08 Sonar Ranging Module ranger being addressed. There are 16 possible addresses (0xE0 - 0xFE, even addresses). The unit code selects a reading that is an actual measurement (inches or cm) or the time-of-flight for the echo to return to the sensor. This routine automatically adjusts the I2C baud rate to a setting that is compatible with the SRF08. Along with the SRF08, this routine and the unit constants are also compatible with the SRF10 and SRF235 sonar modules.
Example:
intVal = aSRF08_RangeInt(0xE0, aSRF08_INCH);
This would take a reading and set intVal equal to the distance to the nearest echo object in inch increments.
version: 1.0, build n.a.
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.