ll40ls: increase the number of samples used to find a correlation peak for LitarLite

Signed-off-by: CarlOlsson <carlolsson.co@gmail.com>
This commit is contained in:
CarlOlsson
2018-04-19 07:52:15 +02:00
committed by Lorenz Meier
parent d75fd72c02
commit cbf3cee096
2 changed files with 14 additions and 3 deletions
@@ -329,18 +329,26 @@ int LidarLiteI2C::measure()
}
/*
reset the sensor to power on defaults
reset the sensor to power on defaults plus additional configurations
*/
int LidarLiteI2C::reset_sensor()
{
int ret = write_reg(LL40LS_MEASURE_REG, LL40LS_MSRREG_RESET);
int ret;
ret = write_reg(LL40LS_MEASURE_REG, LL40LS_MSRREG_RESET);
if (ret != OK) {
return ret;
}
// wait for sensor reset to complete
usleep(1000);
ret = write_reg(LL40LS_SIG_COUNT_VAL_REG, LL40LS_SIG_COUNT_VAL_MAX);
if (ret != OK) {
return ret;
}
// wait for register write to complete
usleep(1000);
return OK;
}
@@ -68,6 +68,9 @@
#define LL40LS_SW_VERSION 0x4f
#define LL40LS_SIGNAL_STRENGTH_REG 0x5b
#define LL40LS_SIG_COUNT_VAL_REG 0x02 /* Maximum acquisition count register */
#define LL40LS_SIG_COUNT_VAL_MAX 0xFF /* Maximum acquisition count max value */
class LidarLiteI2C : public LidarLite, public device::I2C
{
public: