VL53L0X sensor Problem

Hi, i just bought an VL53L0X and i am trying to see how it works but i just can't seem to make it work.
I have already downloaded the library just like the tutorials say but all i get is Failed to boot VL53L0X.

I am using an Arduino Nano and these are my connections:

Arduino----VL53L0X
5v---------Vin
Gnd--------Gnd
A4----------SDA
A5----------SCL

This is the example 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);
}

Please help!

This is the example code:

Typical Adafruit crap.

Adafruit_VL53L0X lox; // = Adafruit_VL53L0X();

Find and run the I2C scanner sketch. Is the device connected correctly? If the I2C scanner doesn't find it, or hangs, it is not. If it does, what is its address?

Hi, Thank you for your response.
Yesterday i did the scanner and i wanted it to do it again but i found with another problem!!

I cant upload skeches to my arduino, this is what i get
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

I tried change the arduino, i select correctly the port and the board and still the same, i reinstalled the arduino IDE also

Do you know what is the problem?
Can you help me?

Regards

Do you know what is the problem?

There is more to the output than that. At the end, there is a message that says "See http://..." for help. Do that.

Ok, done.

This is what i get:

Scanning...
I2C device found at address 0x29 !
done

I have to do something with that??

I have to do something with that??

No. It means that the hardware is working, and that the device was recognized, at address 0x29.

Now, you should re-run the original sketch, making sure that the sketch/library are expecting the device to have that address. IIRC, that is the default address, so you shouldn't need to do anything.

The next step, if the original sketch still fails to begin() the device would be to add some Serial.print() statements to the library, to determine why begin() fails.

//for laser distance sensor CJVL 53L0X v2

#include <Wire.h>
#include <VL53L0X.h>
VL53L0X sensor;
//for laser distance sensor CJVL 53L0X v2

int Clock = A4;
int Data = A5;
int LED = 7;
float distance;

void setup() {
  Serial.begin (9600);
  Wire.begin();
  pinMode (LED, OUTPUT);
  pinMode (Data, INPUT);
  pinMode (Clock, INPUT);
//  pinMode (Servo, OUPPUT);
  sensor.init();
  sensor.setTimeout(500);
}

void loop() {
  distance = (sensor.readRangeSingleMillimeters());
  
  
  Serial.print(sensor.readRangeSingleMillimeters());
  if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }

  Serial.println();
}

Was there a reason to resurrect this dormant thread? If so, you forgot to explain that reason.

you have the wrong board selected, you need to switch to atmegap328 (old bootloader)