cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1_PRESETMODE_RANGING, VL53L1_GetMeasurementDataReady()

ritzeng
Associate II

Calling

   status = sensor_vl53l1.VL53L1_GetMeasurementDataReady(&NewDataReady);

from the Example, I get only status = 0 and NewDataReady = 0;

I stepped into the functions down to the Device access via I2C.

All went well so far. I got:

gpio__tio_hv_status = 3 // VL53L1::VL53L1_is_new_data_ready()

Here the protocol over different functions I made:

7:37:19.140 -> VL53L1 Measurement status:0 - 0

17:37:21.641 -> VL53L1_is_new_data_ready:: gpio__mux_active_high_hv=h 10

17:37:21.641 -> VL53L1_is_new_data_ready:: pdev->stat_cfg.gpio_hv_mux__ctrl=h 11

17:37:21.641 -> VL53L1_is_new_data_ready:: VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_MASK=h 10

17:37:21.641 -> VL53L1_is_new_data_ready:: VL53L1_DEVICEINTERRUPTLEVEL_ACTIVE_HIGH=h 0

17:37:21.641 -> VL53L1_I2CRead:: Beginning transmission to 20

17:37:21.675 -> VL53L1_I2CRead:: Writing port number 49

17:37:21.675 -> VL53L1_I2CRead:: status.1: 0

17:37:21.675 -> VL53L1_I2CRead:: status.2: 0

17:37:21.675 -> VL53L1_I2CRead:: available [i]: 0->3

17:37:21.675 -> VL53L1_is_new_data_ready:: Interrupt ready=0

17:37:21.675 -> VL53L1_is_new_data_ready:: VL53L1_RdByte()=0

17:37:21.675 -> VL53L1_is_new_data_ready:: gpio__tio_hv_status=3

17:37:21.675 -> VL53L1_is_new_data_ready:: *pready=0

When it comes to results of this function:

VL53L1_Error VL53L1::VL53L1_GetMeasurementDataReady(uint8_t *pMeasurementDataReady)

{

VL53L1_Error Status = VL53L1_ERROR_NONE;

Status = VL53L1_is_new_data_ready(Dev, pMeasurementDataReady);

return Status;

}

*pready = pMeasurementDataReady = 0

Status = 0

No Ready will be returned.

When I stepped through the functionality, where and at which step will the READY be provided without interrupt?

at the End in VL53L1_is_new_data_ready() the following decides:

if ((gpio__tio_hv_status & 0x01) == interrupt_ready) {

*pready = 0x01;

} else {

*pready = 0x00;

}

In the Polling Mode you never get a ready with this functions ?

1 REPLY 1
ritzeng
Associate II

I solved the problem. The provided examples software for Arduino Environment's never worked. I will publish my example and the working solution at my GitHub the next days. It's running on ESP 8266 and ESP32 and STM platforms.