adafruit / adafruit_vl53l0x Goto Github PK
View Code? Open in Web Editor NEWArduino library for Adafruit VL53L0X
Arduino library for Adafruit VL53L0X
I followed what claimed to be a link to documentation from this page and ended up at this repo. But I don't see any documentation here. Where is it?
The definition of Adafruit_VL53L0X::rangingTest
in Adafruit_VL53L0X.h
doesn't return the status.
Running on Generic ESP32 DEV Module this sketch
https://github.com/adafruit/Adafruit_VL53L0X/blob/master/examples/vl53l0x/vl53l0x.ino
Works fine using pins 21 and 22
On Esp32 S2 where i2c pins are 8 and 9 i get Failed to boot VL53L0X
I run a simple sketch to scan i2c connected and with both boards i get that there is a device connected at address 0x29 so is connected correctly.
ESP32: Adafruit HUZZAH32 – ESP32 Feather Board (Firmware Release 1.0.2)
VL53L0X: CJVL53L0XV2
After burning example code into ESP32, serial prompts the following content and the board keep rebooting.
After switching to the pololu library, the board works just fine
⸮)⸮�]⸮�!⸮⸮O�⸮�⸮k⸮⸮⸮⸮Յ⸮⸮!⸮Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception` was unhandled.
Core 1 register dump:
PC : 0x400d5668 PS : 0x00060130 A0 : 0x800d0f80 A1 : 0x3ffb1f10
A2 : 0x3ffbdf10 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00000017
A6 : 0x00000000 A7 : 0x3ffbdf10 A8 : 0x800d5668 A9 : 0x3ffb1ee0
A10 : 0x04c4b400 A11 : 0x00000016 A12 : 0x00000000 A13 : 0x00000064
A14 : 0x00000000 A15 : 0x60013000 SAR : 0x0000000a EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
Backtrace: 0x400d5668:0x3ffb1f10 0x400d0f7d:0x3ffb1f30 0x400d48f6:0x3ffb1f50 0x400d0d81:0x3ffb1f80 0x400d6dab:0x3ffb1fb0 0x400877c1:0x3ffb1fd0
Rebooting...
⸮⸮⸮8�⸮
A�B⸮⸮⸮t��!y⸮⸮:S⸮⸮⸮ĥ⸮Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled.
Core 1 register dump:
PC : 0x400d5668 PS : 0x00060130 A0 : 0x800d0f80 A1 : 0x3ffb1f10
A2 : 0x3ffbdf10 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00000017
A6 : 0x00000000 A7 : 0x3ffbdf10 A8 : 0x800d5668 A9 : 0x3ffb1ee0
A10 : 0x04c4b400 A11 : 0x00000016 A12 : 0x00000000 A13 : 0x00000064
A14 : 0x00000000 A15 : 0x60013000 SAR : 0x0000000a EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
Backtrace: 0x400d5668:0x3ffb1f10 0x400d0f7d:0x3ffb1f30 0x400d48f6:0x3ffb1f50 0x400d0d81:0x3ffb1f80 0x400d6dab:0x3ffb1fb0 0x400877c1:0x3ffb1fd0
Rebooting...`
In file included from .../Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_device.h:37:0,
from .../Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_def.h:90,
from .../Arduino/libraries/Adafruit_VL53L0X/src/platform/src/vl53l0x_i2c_comms.cpp:2:
.../Arduino/libraries/Adafruit_VL53L0X/src/vl53l0x_types.h:56:108: note: #pragma message: Please review type definition of STDINT define for your platform and add to list above
#pragma message("Please review type definition of STDINT define for your platform and add to list above ")
Hello,
I try to connect multiple sensors but it retourn me just one fixe value when I connect the second sensor... Do you have an idea ? Thanks
#include <Wire.h>
#include "Adafruit_VL53L0X.h"
#define SHUT_LOX 2
#define SHUT_LOX2 5
#define LOX_Adr 0x29
#define LOX2_Adr 0x30
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
Adafruit_VL53L0X lox2 = Adafruit_VL53L0X();
void setup() {
// INIT SERIAL
Serial.begin(9600);
while (! Serial) {
delay(1);
}
Serial.println("Serial init ==> OK");
// INIT SENSORS DISTANCE
pinMode(SHUT_LOX,OUTPUT);
pinMode(SHUT_LOX2,OUTPUT);
delay(500);
Wire.begin();
Serial.println("Reset BOTH");
digitalWrite(SHUT_LOX,LOW);
digitalWrite(SHUT_LOX2,LOW);
delay(10); // Reset all sensors by setting all of their XSHUT pins low for delay(10), then set all XSHUT high to bring out of reset
digitalWrite(SHUT_LOX,HIGH);
digitalWrite(SHUT_LOX2,HIGH);
digitalWrite(SHUT_LOX,LOW);
digitalWrite(SHUT_LOX2,LOW);
Serial.println("Reset OK");
Serial.println("Init VL53L0X _ LOX");
//digitalWrite(SHUT_LOX2, LOW);
digitalWrite(SHUT_LOX, HIGH);
delay(10);
Serial.println("InitLOX.....");
lox.setAddress(LOX_Adr);
pinMode(SHUT_LOX, INPUT);
if (!lox.begin(LOX_Adr)) {
Serial.println(F("Failed to boot VL53L0X _ LOX"));
//while (1);
} else {
Serial.println(F(" ==> OK"));
}
delay(2000);
// init LOX2
Serial.println("InitLOX 2.....");
Serial.println("Init VL53L0X _ LOX2");
//digitalWrite(SHUT_LOX, LOW);
digitalWrite(SHUT_LOX2,HIGH);
delay(1);
lox2.setAddress(LOX2_Adr);
pinMode(SHUT_LOX2, INPUT);
if (!lox2.begin(LOX2_Adr)) {
Serial.println(F("Failed to boot VL53L0X _ LOX2"));
//while (1);
} else {
Serial.println(F(" ==> OK"));
}
//delay(1);
//digitalWrite(SHUT_LOX, HIGH);
// END INIT SENSORS
}
void loop() {
//capteur distance
VL53L0X_RangingMeasurementData_t measure;
lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!
Serial.println(measure.RangeMilliMeter);
Serial.print(" ");
}
The example uses a delay at the end of loop of 100 ms. How much can this be shortened?
PR #49 was passing CI checks on its last commit. But after merging, CI is failing on missing dox. Not sure why that wasn't caught in the PR itself. Maybe the CI checks changed.
Anywho, need dox for:
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:84: warning: Member startMeasurement(boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:85: warning: Member stopMeasurement(boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:86: warning: Member getLimitCheckCurrent(uint8_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:89: warning: Member getDeviceMode(VL53L0X_DeviceModes *pDeviceMode, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:91: warning: Member setDeviceMode(VL53L0X_DeviceModes DeviceMode, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:94: warning: Member setInterruptThresholds(FixPoint1616_t ThresholdLow, FixPoint1616_t ThresholdHigh, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:97: warning: Member getInterruptThresholds(FixPoint1616_t *pThresholdLow, FixPoint1616_t *pThresholdHigh, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:100: warning: Member clearInterruptMask(boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:102: warning: Member getGpioConfig(VL53L0X_DeviceModes *pDeviceMode, VL53L0X_GpioFunctionality *pFunctionality, VL53L0X_InterruptPolarity *pPolarity, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
/home/runner/work/Adafruit_VL53L0X/Adafruit_VL53L0X/src/Adafruit_VL53L0X.h:106: warning: Member setGpioConfig(VL53L0X_DeviceModes DeviceMode, VL53L0X_GpioFunctionality Functionality, VL53L0X_InterruptPolarity Polarity, boolean debug=false) (function) of class Adafruit_VL53L0X is not documented.
@Vgdn1942 Can you make a follow on PR with dox?
@caternuson: I installed it with the arduino library manager, and did not modfify it. It seems there is/was(?) a problem with the way of installing. Maybe it's got some old or debug branch.
I tried to compile the sample code and got the following errors
Tried it with all 3 examples, all had similar issues.
11x 'error: stray '@' in program'
3x 'error: stray '\205' in program'
3x 'error: stray '\251' in program'
3x 'error: 'Skip' does not name a type'
2x 'error: 'TwoWire' does not name a type'
error: 'TwoWire' was not declared in this scope
8x error: 'TwoWire' has not been declared
error: 'i2c' was not declared in this scope
2x error: expected unqualified-id before numeric constant
error: 'Skip' does not name a type
error: 'Wire' was not declared in this scope
2x error: 'lox1' was not declared in this scope
error: call to 'boolean Adafruit_VL53L0X::begin(uint8_t, boolean, int*)' uses the default argument for parameter 3, which is not yet defined
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:0:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:39:1: error: stray '@' in program
@chetan-prime chetan-prime Add support for specifying an alternate I2C bus other than the hardco… 1563a9e on Sep 29, 2018
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:39:1: error: stray '\205' in program
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:40:1: error: stray '@' in program
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:41:1: error: stray '@' in program
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:42:1: error: stray '@' in program
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:43:1: error: stray '@' in program
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api_strings.h:33:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:32,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:39:1: error: stray '@' in program
@chetan-prime chetan-prime Add support for specifying an alternate I2C bus other than the hardco… 1563a9e on Sep 29, 2018
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:39:1: error: stray '\205' in program
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:40:1: error: stray '@' in program
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:41:1: error: stray '@' in program
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api_strings.h:33:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:32,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:284:5: error: stray '\251' in program
© 2019 GitHub, Inc.
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:34:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:39:1: error: stray '@' in program
@chetan-prime chetan-prime Add support for specifying an alternate I2C bus other than the hardco… 1563a9e on Sep 29, 2018
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:39:1: error: stray '\205' in program
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:40:1: error: stray '@' in program
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:41:1: error: stray '@' in program
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:284:5: error: stray '\251' in program
© 2019 GitHub, Inc.
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:0:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:112:5: error: stray '\251' in program
© 2019 GitHub, Inc.
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:0:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:2:1: error: 'Skip' does not name a type
Skip to content
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:68:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:82:8: error: 'TwoWire' does not name a type
extern TwoWire Wire;
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api_strings.h:33:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:32,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:2:1: error: 'Skip' does not name a type
Skip to content
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:75:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api_strings.h:33,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:32,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:5:22: error: 'TwoWire' was not declared in this scope
int VL53L0X_i2c_init(TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:5:31: error: 'i2c' was not declared in this scope
int VL53L0X_i2c_init(TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:6:95: error: 'TwoWire' has not been declared
int VL53L0X_write_multi(uint8_t deviceAddress, uint8_t index, uint8_t *pdata, uint32_t count, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:7:94: error: 'TwoWire' has not been declared
int VL53L0X_read_multi(uint8_t deviceAddress, uint8_t index, uint8_t *pdata, uint32_t count, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:8:76: error: 'TwoWire' has not been declared
int VL53L0X_write_byte(uint8_t deviceAddress, uint8_t index, uint8_t data, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:9:77: error: 'TwoWire' has not been declared
int VL53L0X_write_word(uint8_t deviceAddress, uint8_t index, uint16_t data, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:10:78: error: 'TwoWire' has not been declared
int VL53L0X_write_dword(uint8_t deviceAddress, uint8_t index, uint32_t data, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:11:76: error: 'TwoWire' has not been declared
int VL53L0X_read_byte(uint8_t deviceAddress, uint8_t index, uint8_t *data, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:12:77: error: 'TwoWire' has not been declared
int VL53L0X_read_word(uint8_t deviceAddress, uint8_t index, uint16_t *data, TwoWire *i2c);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_i2c_platform.h:13:78: error: 'TwoWire' has not been declared
int VL53L0X_read_dword(uint8_t deviceAddress, uint8_t index, uint32_t *data, TwoWire *i2c);
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api_strings.h:33:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:32,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:106:5: error: 'TwoWire' does not name a type
TwoWire *i2c;
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api_strings.h:33:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:32,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:284:7: error: expected unqualified-id before numeric constant
© 2019 GitHub, Inc.
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_api.h:34:0,
from [...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:69,
from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/vl53l0x_platform.h:2:1: error: 'Skip' does not name a type
Skip to content
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:0:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:81:85: error: 'TwoWire' has not been declared
boolean begin(uint8_t i2c_addr = VL53L0X_I2C_ADDR, boolean debug = false, TwoWire *i2c = &Wire);
^
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:81:101: error: 'Wire' was not declared in this scope
boolean begin(uint8_t i2c_addr = VL53L0X_I2C_ADDR, boolean debug = false, TwoWire *i2c = &Wire);
^
In file included from [...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino:1:0:
[...]\Arduino\libraries\Adafruit_VL53L0X\src/Adafruit_VL53L0X.h:112:7: error: expected unqualified-id before numeric constant
© 2019 GitHub, Inc.
^
[...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino: In function 'void setID()':
vl53l0x_dual:42: error: 'lox1' was not declared in this scope
if(!lox1.begin(LOX1_ADDRESS)) {
^
vl53l0x_dual:53: error: call to 'boolean Adafruit_VL53L0X::begin(uint8_t, boolean, int*)' uses the default argument for parameter 3, which is not yet defined
if(!lox2.begin(LOX2_ADDRESS)) {
^
[...]\Arduino\libraries\Adafruit_VL53L0X\examples\vl53l0x_dual\vl53l0x_dual.ino: In function 'void read_dual_sensors()':
vl53l0x_dual:61: error: 'lox1' was not declared in this scope
lox1.rangingTest(&measure1, false); // pass in 'true' to get debug data printout!
^
exit status 1
'lox1' was not declared in this scope
There is a warning raised these days for not initialised things, and this has now bitten me when compiling this library into adafruit wippersnapper adafruit/Adafruit_Wippersnapper_Arduino#363 (comment)
The warning is:
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp: In function 'VL53L0X_Error VL53L0X_StaticInit(VL53L0X_DEV)':
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::HistogramMode' [-Wmissing-field-initializers]
VL53L0X_DeviceParameters_t CurrentParameters = {0};
^
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::MeasurementTimingBudgetMicroSeconds' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::InterMeasurementPeriodMilliSeconds' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::XTalkCompensationEnable' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::XTalkCompensationRangeMilliMeter' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::XTalkCompensationRateMegaCps' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::RangeOffsetMicroMeters' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::LimitChecksEnable' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::LimitChecksStatus' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::LimitChecksValue' [-Wmissing-field-initializers]
/home/runner/Arduino/libraries/Adafruit_VL53L0X/src/core/src/vl53l0x_api.cpp:531:52: warning: missing initializer for member 'VL53L0X_DeviceParameters_t::WrapAroundCheckEnable' [-Wmissing-field-initializers]
pinging @brentru to stick on the backlog
Adafruit_VL53L0X/library.properties
Line 10 in e5bf0ba
Hello,
I was just wondering how can I change the different modes of the sensor with this library.
Let me know,
Thanks
How do I connect the VL53L0X to the Arduino? Which pins do I use for SCL and SDA? And do I have to connect Xshut and GPIO?
Thank you!
Hello!
How may i disable all this Information when i just want the last value?
Writing 1 to addr 0x80: 0x1, Writing 1 to addr 0xFF: 0x1, Writing 1 to addr 0x0: 0x0, Writing 1 to addr 0x91: 0x3C, Writing 1 to addr 0x0: 0x1, Writing 1 to addr 0xFF: 0x0, Writing 1 to addr 0x80: 0x0, Writing 1 to addr 0x0: 0x1, Reading 1 from addr 0x0: 0x0, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x40, Reading 1 from addr 0x13: 0x44, Reading 12 from addr 0x14: 0x5B, 0x6, 0x4C, 0x4, 0x33, 0xE3, 0xA, 0xF9, 0x0, 0x12, 0x0, 0xA0, Writing 1 to addr 0xFF: 0x1, Reading 2 from addr 0xB6: 0x9, 0x58, Writing 1 to addr 0xFF: 0x0, Writing 1 to addr 0xB: 0x1, Writing 1 to addr 0xB: 0x0, Reading 1 from addr 0x13: 0x40, 160
My code looks like this:
lox.getSingleRangingMeasurement(&measure, false); Serial.println(measure.RangeMilliMeter);
Problem: If one attempts to use this library as a part of another Arduino library, the sketch will not compile.
Reason: The source files in the \core and \platform contain header includes that do not have a path included, they point to header files within the same directory.
Solution:
Arduino board: ESP8266 NodeMCU Lolin (V3)
Arduino IDE version (found in Arduino -> About Arduino menu): Arduino IDE 2.0.3
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): In examples vl53l0x_dual and vl53l0x_multi_extended_test are initialized 2 sensors VL53L0x only
I don't know how to initialize 3 sensors.
Thanks.
Hello, is there a way to enable a high speed mode on the sensor? It may just be shortening the period it takes to read/process...?
Adafruit_VL53L0X/src/Adafruit_VL53L0X.h
Lines 74 to 75 in 7ea8e39
Adafruit_VL53L0X/src/Adafruit_VL53L0X.cpp
Lines 53 to 54 in 7ea8e39
I found these variables that are never used. Removing them can free up memory on the microcontroller.
Hi,
Is there a sample for continuous ranging mode?
Thanks
Routine VL53L0X_perform_offset_calibration
from src/core/src/vl53l0x_api_calibration.cpp is giving strange results. By my opinion the problem is in uint16_t sum_ranging
which should be of type
uint32_t
due to later bit shifting (<<16), which needs to be done due to fixed point arithmetics.
(I was performing this calibration at 270 mm distance, which is due to documentation not optimal one, but after the fixes it works fine).
In case of VL53L0X_perform_xtalk_calibration
the same goes for multiple variables (sum_ranging, ...) that accumulate the range measurements performed by the routine. Unfortunately there are some other errors present due to which the calibration routine doesn't produce an appropriate XTalkCompensationRateMegaCps
value. Due to the lack of understanding what this calibration routine is trying to compute, I am not able to figure it out why.
(I was performing this calibraton at 600 mm distance).
Hello, i use this lib to read distance from VL53L0X. i use vl53l0x example to test but in serial monitor show
Adafruit VL53L0X test
Failed to boot VL53L0X
so i check communication between esp32 and VL53L0X via logic analyzer i found esp32 found 0x29 device address but in serial monitor show Failed to boot
How to fix this ?
Thanks !
In the file Adafruit_VL53L0X.cpp at line 100 it is written:
if( ( DeviceInfo.ProductRevisionMinor != 1 ) && ( DeviceInfo.ProductRevisionMinor != 1 ) )
I think this line should be:
if( ( DeviceInfo.ProductRevisionMajor != 1 ) && ( DeviceInfo.ProductRevisionMinor != 1 ) )
I use example code and everything works fine, but when I put the sensor without a barrier or to get out of range, the output from Arduino Serial Monitoring sometime shows random numbers such as 2mm or 4mm. How to solve this, just make sure the result/output is always out of range not random numbers.
Expected behaviour
Building with USE_EMPTY_STRING defined reduces memory usage on memory constrained environments such as Arduino Nano.
Actual behaviour
Sketch fails to build due to several missing constants, eg: VL53L0X_STRING_ERROR_INTERRUPT_NOT_CLEARED
Environment
Tested on PlatformIO
I'd like to "port" this library to put it onto the Particle Build IDE, but for that I'd like to provide a LICENSE file too.
I've downloaded the original STM API which comes with this license agreement
http://www.st.com/resource/en/license_agreement/dm00299899.pdf
And your lib looks pretty similar, so I'm not sure what license to include in my "port" to keep everybody happy and stay out of trouble ;-)
I see that the api has VL53L0X_SetRangeFractionEnable.
Has anyone got this enabled and working? Plz share the code!
It isn't enabled by default and so measure.RangeFractionalPart always returns 0.
The TOF sensor is currently due to my lack of understanding, hanging in a loop where it does not work properly.
I enabled debug mode and 'fiddled' around with the sensor untill the error occured.
sVL53L0X: PerformSingleRangingMeasurement
Range Status: 8 : No Update
RANGE IGNORE THRESHOLD: 15.60
Measured distance: 1
Between the PerformSingleRangingMeasurment and Range Status pass +30 Seconds.
A timeout if that error occurs would be great!
Thank you.
Would you please write a short description of included keywords in front of every keyword for ' Adafruit_VL53L0X/keywords.txt '
The interrupt example doesn't work. The interrupt is simply ignored. I.e. the distance is displayed although only the range of 50-100mm should be displayed.
Adafruit_VL53L0X/src/Adafruit_VL53L0X.cpp
Line 110 in 7ea8e39
There are two equal expressions in this if statment
Adafruit_VL53L0X.h can be imported multiple times causing name space errors at compile time.
Hey,
I followed the setup for the vl53l0x as shown in --> https://learn.adafruit.com/adafruit-vl53l0x-micro-lidar-distance-sensor-breakout/arduino-code, but the program is not running correctly.
Serial.println("Adafruit VL53L0X test");
Serial.println("this is a test");
if (!lox.begin()) {
Serial.println("this failed to boot");
Serial.println(F("Failed to boot VL53L0X"));
while(1);
}
Serial.println("I got through the boot stage");
When I open the serial window, I get "Adafruit VL53L0X test" and "this is a test", but I don't get anything after that. This makes me think that the program is not getting by lox.begin().
Any advice?
Cheers
Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:
Do not use GitHub issues for troubleshooting projects and issues. Instead use
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
something isn't working as expected. In many cases the problem is a common issue
that you will more quickly receive help from the forum community. GitHub issues
are meant for known defects in the code. If you don't know if there is a defect
in the code then start with troubleshooting on the forum first.
If following a tutorial or guide be sure you didn't miss a step. Carefully
check all of the steps and commands to run have been followed. Consult the
forum if you're unsure or have questions about steps in a guide/tutorial.
For Arduino projects check these very common issues to ensure they don't apply:
For uploading sketches or communicating with the board make sure you're using
a USB data cable and not a USB charge-only cable. It is sometimes
very hard to tell the difference between a data and charge cable! Try using the
cable with other devices or swapping to another cable to confirm it is not
the problem.
Be sure you are supplying adequate power to the board. Check the specs of
your board and plug in an external power supply. In many cases just
plugging a board into your computer is not enough to power it and other
peripherals.
Double check all soldering joints and connections. Flakey connections
cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.
Ensure you are using an official Arduino or Adafruit board. We can't
guarantee a clone board will have the same functionality and work as expected
with this code and don't support them.
If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:
Arduino board: esp32-s3
Arduino IDE version (found in Arduino -> About Arduino menu): latest - Platformio
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too):
Steps to reproduce:
Adafruit_VL53L0X
on esp32-s3
.This library calls begin()
on the Twowire
object, which is an issue when running the sensors on an I2C multiplexer, as the multiplexer needs to call begin()
on the TwoWire
object itself. This causes the I/O read timeout error to occur.
Documentation page at http://adafruit.github.io/Adafruit_VL53L0X/html/index.html appears to be missing the documentation.
Hi,
I know this sounds weird, but it really appears to be the case here.
I can connect other sensors just fine (the TSL2591 for example), on an external power source too, and it just works. Note: i want to use an external power source because feeding the i2c censors i have via just arduino is simply going to draw too much current.
When i swap the wires from the TSL2591 to the VL53L0X, it simply fails with:
Adafruit VL53L0X test
Failed to boot VL53L0X
And yes, if i use the arduino (micro) to power the chip, it works just fine. I do have a common ground.
You probably need more information so i enabled debugging:
void setup() {
Serial.begin(115200);
// wait until serial port opens for native USB devices
while (! Serial) {
delay(1);
}
Serial.println("Adafruit VL53L0X test");
if (!lox.begin(0x29, true)) {
Serial.println(F("Failed to boot VL53L0X"));
while(1);
}
// power
Serial.println(F("VL53L0X API Simple Ranging example\n\n"));
}
Note the:
if (!lox.begin(0x29, true)) {
With that enabled, it spits out:
Adafruit VL53L0X test
VL53L0X Info:
Device Name: VL53L0X TS1, Type: VL53L0X, ID: ␃Ap8␜␎␇␃A
p8␜␎␇␃A
Rev Major: 1, Minor: 1
VL53L0X: StaticInit
VL53L0X Error: -50
Failed to boot VL53L0X
The error (-50) means:
/*!< In the function a division by zero occurs */
#define VL53L0X_ERROR_REF_SPAD_INIT ((VL53L0X_Error) -50)
Which clearly points at a code issue... Somewhere...
When further investigating that error, i found this thread:
https://community.st.com/s/question/0D50X00009XkYOCSA3/spad-initialization-error
Which has a response (from just one month ago) from a ST employee with an apparent fix. I'm not quite sure if that is "the" fix for this issue, i haven't testes it yet.
Is there any more information that is required of me to fix this?
Best regards,
Mark
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.