I have doubts about my VL53L0X sketch

[color=#202124][b]hello everyone, I have to write the sketch on Arduino of the VL53L0X sensor management program, help me ....
[/b][/color]
[pre][color=#202124]I did so but I have doubts 

[/color]

[/pre]

[color=#373737]#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);
}[/color]

@cedra

Your topic was Moved to it's current location / section as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Does it do what you want it to do? If not, why?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.