Hi...
I have a project using VL53L0X sensor, i have library from Arduino Code | Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout | Adafruit Learning System, then found "Failed to boot VL53L0X" written on serial monitor
I connect
VL53L0X ---------- Arduino
VCC _______ 5V
GND _______ GND
SCL _______ A5
SDA _______ A4
This is the code :
#include "Adafruit_VL53L0X.h"
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
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()) {
Serial.println(F("Failed to boot VL53L0X"));
while(1);
}
// power
Serial.println(F("VL53L0X API Simple Ranging example\n\n"));
}
void loop() {
VL53L0X_RangingMeasurementData_t measure;
Serial.print("Reading a measurement... ");
lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!
if (measure.RangeStatus != 4) { // phase failures have incorrect data
Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter);
} else {
Serial.println(" out of range ");
}
delay(100);
}
Then, it was written below the code while uploading
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_core.cpp: In function 'uint32_t VL53L0X_isqrt(uint32_t)':
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_core.cpp:132:23: warning: left shift count >= width of type [-Wshift-count-overflow]
uint32_t bit = 1 << 30;
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_core.cpp: In function 'VL53L0X_Error VL53L0X_calc_sigma_estimate(VL53L0X_DEV, VL53L0X_RangingMeasurementData_t*, FixPoint1616_t*, uint32_t*)':
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_core.cpp:1923:20: warning: left shift count >= width of type [-Wshift-count-overflow]
pwMult *= ((1 << 16) - xTalkCorrection);
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_core.cpp:1929:19: warning: left shift count >= width of type [-Wshift-count-overflow]
pwMult += (1 << 16);
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api.cpp: In function 'VL53L0X_Error VL53L0X_GetInterruptThresholds(VL53L0X_DEV, VL53L0X_DeviceModes, FixPoint1616_t*, FixPoint1616_t*)':
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api.cpp:2822:63: warning: left shift count >= width of type [-Wshift-count-overflow]
*pThresholdLow = (FixPoint1616_t)((0x00fff & Threshold16) << 17);
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api.cpp:2829:48: warning: left shift count >= width of type [-Wshift-count-overflow]
(FixPoint1616_t)((0x00fff & Threshold16) << 17);
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_calibration.cpp: In function 'VL53L0X_Error VL53L0X_perform_xtalk_calibration(VL53L0X_DEV, FixPoint1616_t, FixPoint1616_t*)':
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_calibration.cpp:120:19: warning: left shift count >= width of type [-Wshift-count-overflow]
sum_ranging << 16) / total_count);
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_calibration.cpp:122:17: warning: left shift count >= width of type [-Wshift-count-overflow]
sum_spads << 16) / total_count);
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_calibration.cpp:166:38: warning: left shift count >= width of type [-Wshift-count-overflow]
signalXTalkTotalPerSpad *= ((1 << 16) -
^
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_calibration.cpp: In function 'VL53L0X_Error VL53L0X_perform_offset_calibration(VL53L0X_DEV, FixPoint1616_t, int32_t*)':
C:\Users\DELL\Documents\Arduino\libraries\Adafruit_VL53L0X\src\core\src\vl53l0x_api_calibration.cpp:255:64: warning: left shift count >= width of type [-Wshift-count-overflow]
StoredMeanRange = (FixPoint1616_t)((uint32_t)(sum_ranging << 16)
^
Sketch uses 17428 bytes (6%) of program storage space. Maximum is 253952 bytes.
Global variables use 1236 bytes (15%) of dynamic memory, leaving 6956 bytes for local variables. Maximum is 8192 bytes.
Please help me to solve it, thank you...