I tried all examples but I my sensor never achieve to init() itself.
The sensor is detected with an i2c scanner (address 0x29) but beside that I can never init() properly.
Sensor VIN is plugged to 3V3, GND to my esp32 GND, SDA/SCL to SDA/SCL on my esp32 board (pin 21 & 22).
Code is as simple as:
#define I2C_SDA 21
#define I2C_SCL 22
#include <SPI.h>
#include <VL53L0X.h>
#include <Wire.h>
VL53L0X sensor;
void setup()
{
Serial.begin(9600);
// wait until serial port opens for native USB devices
while (!Serial) {
delay(1);
}
Wire.begin(I2C_SDA, I2C_SCL);
//sensor.setAddress((uint8_t)0x29);
sensor.setTimeout(500);
if (!sensor.init()) {
Serial.println("Failed to detect and initialize sensor!");
while (42);
}
}
I always get "Failed to detect and initialize sensor!" on my serial console.
An i2c scanner returns:
Found address: 41 (0x29)
Done.
Found 1 device(s).
Any idea why that happens?
My sensor is labeled VL53L0/1XV2.
I tried all examples but I my sensor never achieve to init() itself.
The sensor is detected with an i2c scanner (address 0x29) but beside that I can never init() properly. Sensor VIN is plugged to 3V3, GND to my esp32 GND, SDA/SCL to SDA/SCL on my esp32 board (pin 21 & 22).
Code is as simple as:
I always get "Failed to detect and initialize sensor!" on my serial console.
An i2c scanner returns:
Any idea why that happens?
My sensor is labeled VL53L0/1XV2.