File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
examples/Example1_ReadDistance Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change
1
+ #include < ComponentObject.h>
2
+ #include < RangeSensor.h>
3
+ #include < SparkFun_VL53L1X.h>
4
+ #include < vl53l1x_class.h>
5
+ #include < vl53l1_error_codes.h>
6
+
1
7
/*
2
8
Reading distance from the laser based VL53L1X
3
9
By: Nathan Seidle
@@ -32,8 +38,9 @@ void setup(void)
32
38
Serial.println (" VL53L1X Qwiic Test" );
33
39
34
40
if (distanceSensor.begin () == false )
41
+ {
35
42
Serial.println (" Sensor online!" );
36
-
43
+ }
37
44
}
38
45
39
46
void loop (void )
Original file line number Diff line number Diff line change 1
1
name =SparkFun VL53L1X 4m Laser Distance Sensor
2
- version =1.1.2
2
+ version =1.1.3
3
3
author =SparkFun Electronics <
[email protected] >
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 @@ -230,7 +230,7 @@ void SFEVL53L1X::setOffset(int16_t offset)
230
230
231
231
int16_t SFEVL53L1X::getOffset ()
232
232
{
233
- uint16_t temp;
233
+ int16_t temp;
234
234
_device->VL53L1X_GetOffset (&temp);
235
235
return temp;
236
236
}
@@ -326,11 +326,11 @@ void SFEVL53L1X::startTemperatureUpdate()
326
326
void SFEVL53L1X::calibrateOffset (uint16_t targetDistanceInMm)
327
327
{
328
328
int16_t offset = getOffset ();
329
- _device->VL53L1X_CalibrateOffset (targetDistanceInMm, offset);
329
+ _device->VL53L1X_CalibrateOffset (targetDistanceInMm, & offset);
330
330
}
331
331
332
332
void SFEVL53L1X::calibrateXTalk (uint16_t targetDistanceInMm)
333
333
{
334
- int16_t xTalk = getXTalk ();
335
- _device->VL53L1X_CalibrateXtalk (targetDistanceInMm, xTalk);
334
+ uint16_t xTalk = getXTalk ();
335
+ _device->VL53L1X_CalibrateXtalk (targetDistanceInMm, & xTalk);
336
336
};
You can’t perform that action at this time.
0 commit comments