Skip to content
Snippets Groups Projects
Commit cbf3cee0 authored by CarlOlsson's avatar CarlOlsson Committed by Lorenz Meier
Browse files

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

parent d75fd72c
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment