API for the MB704x MaxSonar-WR Ultrasonic Ranger.
More...
This driver was tested with the MB704x MaxSonar-WR Ultrasonic Ranger using the long distance, weather resistant horn. Depending on your sensor type and horn, tanges from 20cm to 750cm are possible.
while (shouldRun) {
cout <<
"Range: " << sensor.
getRange() <<
" cm" << endl;
upm_delay_ms(500);
}
cout << "Exiting..." << endl;
MB704X |
( |
unsigned int |
bus = 0 , |
|
|
unsigned int |
addr = 112 |
|
) |
| |
Initialize a device context.
- Parameters
-
bus | Specify which the I2C bus to use. The default is 0. |
addr | Specify the I2C address to use. The default is 112. |
Query the device for a range reading. The range will be reported in centimeters (cm).
- Parameters
-
- Returns
- Measured range, -1 on error. The range is reported in centimeters (cm).
The documentation for this class was generated from the following files: