API for the LIDARLITEV3 Optical Distance Measurement Sensor.
More...
It is a compact, high-performance optical distance measurement sensor from Garmin. [LIDARLITEV3 Datasheet] http://static.garmin.com/pumac/LIDAR_Lite_v3_Operation_Manual_and_Technical_Specifications.pdf
while (!doWork) {
std::cout << "Distance = " << sensor.getDistance() << std::endl;
upm_delay_us(50000);
}
Instantiates an LIDARLITEV3 object
- Parameters
-
bus | Number of the used bus |
devAddr | Address of the used I2C device: 0x62 |
LIDARLITEV3 object destructor; basically, it closes the I2C connection.
~LIDARLITEV3 (); no need for the destructor - the I2c connection will be closed when m_i2ControlCtx variable will be out of context Returns distance measurement on success Retruns -1 on failure.
uint16_t read |
( |
int |
reg, |
|
|
bool |
monitorBusyFlag |
|
) |
| |
Read Perform I2C read from device.
- Parameters
-
reg | register address to read from. |
monitorBusyFlag | if true, the routine will repeatedly read the status register until the busy flag (LSB) is 0. |
Returns the name of the component
uint8_t i2cReadReg_8 |
( |
int |
reg | ) |
|
Reads a one-byte register
- Parameters
-
reg | Address of the register |
uint16_t i2cReadReg_16 |
( |
int |
reg | ) |
|
Reads a two-byte register
- Parameters
-
reg | Address of the register |
mraa::Result i2cWriteReg |
( |
uint8_t |
reg, |
|
|
uint8_t |
value |
|
) |
| |
Writes to a one-byte register
- Parameters
-
reg | Address of the register |
value | Byte to be written |
The documentation for this class was generated from the following files: