Range data getting saturated after 50mm in VL6180X proximity sensor
Hello,
We have integrated VL6180X proximity sensor with our Nordic chip. With help of ST application note we have prepared library for VL6180X sensor. We have consider all necessary setting mentioned in application note.
We are facing one strange issue. We are successfully getting range uptill 50mm but once object crosses 50mm it always show 255mm.
We tried many things like putting delay, changing I2C clock, switching to continuous mode but no luck till now.
I am attaching my VL6180X library and header file. Can anyone go through it and point out mistake if any.
Quick response will be highly appreciated.
Below is my Main.c file routine.
int main()
{
int range;
// load settings onto VL6180X
Init_Range_sensor();
Set_Default_Sensor_Data();
while (1)
{
twi_enable();
// start single range measurement
Start_Range_Sensor_Data();
// poll the VL6180X till new sample ready
Poll_Range_Sensor();
// read range result
range_mm = Read_Range();
printf("Range in mm = d\r\n",range_mm);
// clear the interrupt on VL6180X
Clear_VL6180_Sensor_Interrupt();
wait(0.1);
twi_disable();
}
}
