File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
name =SparkFun VL53L1X 4m Laser Distance Sensor
2
- version =1.2.2
2
+ version =1.2.3
3
3
author =SparkFun Electronics <techsupport@sparkfun.com>
4
4
maintainer =SparkFun Electronics <sparkfun.com>
5
5
sentence =Library for the SparkFun Qwiic 4m Distance Sensor - VL53L1X
Original file line number Diff line number Diff line change @@ -173,14 +173,20 @@ VL53L1X_ERROR VL53L1X::VL53L1X_SetI2CAddress(uint8_t new_address)
173
173
VL53L1X_ERROR VL53L1X::VL53L1X_SensorInit ()
174
174
{
175
175
VL53L1X_ERROR status = 0 ;
176
- uint8_t Addr = 0x00 , tmp=0 ;
176
+ uint8_t Addr = 0x00 , tmp=0 , timeout = 0 ;
177
177
178
178
for (Addr = 0x2D ; Addr <= 0x87 ; Addr++){
179
179
status = VL53L1_WrByte (Device, Addr, VL51L1X_DEFAULT_CONFIGURATION[Addr - 0x2D ]);
180
180
}
181
181
status = VL53L1X_StartRanging ();
182
182
while (tmp==0 ){
183
- status = VL53L1X_CheckForDataReady (&tmp);
183
+ status = VL53L1X_CheckForDataReady (&tmp);
184
+ timeout++;
185
+ if (timeout > 50 )
186
+ {
187
+ status = VL53L1_ERROR_TIME_OUT;
188
+ return status;
189
+ }
184
190
}
185
191
tmp = 0 ;
186
192
status = VL53L1X_ClearInterrupt ();
You can’t perform that action at this time.
0 commit comments