GY6180 TOF Laser library file

Does anyone know where I can find the file ?
The closest file I can find is for the VL6180X.
I ran the example sketch but it doesn't work.

Thanks,
TT

have a look at how-to-get-the-best-out-of-this-forum
e.g.

  1. can you give link to the device or if not a photo
  2. what is the host microcontroller?
  3. how did you connect the GY6180?
  4. which library are you using and which test program?
  5. did you try running the I2C scanner?

The module name is GY6180 and carries a VL6180x sensor, so you must use the library for the VL6180x.

using the Pololu VL6180X Time-of-Flight Distance Sensor I have used the Adafruit_VL6180X and the VL6180X libraries with the UNO and ESP32

Here is a pic of the TOF

I tried this sketch, and it is working. The other sketch I tried didn't work. All is good now.
Thanks for your replies.
Cheers,
TT

#include <Wire.h>
#include <VL6180X.h>

VL6180X sensor;

void setup()
{
  Serial.begin(9600);
  Wire.begin();

  sensor.init();
  sensor.configureDefault();

  // Reduce range max convergence time and ALS integration
  // time to 30 ms and 50 ms, respectively, to allow 10 Hz
  // operation (as suggested by table "Interleaved mode
  // limits (10 Hz operation)" in the datasheet).
  sensor.writeReg(VL6180X::SYSRANGE__MAX_CONVERGENCE_TIME, 30);
  sensor.writeReg16Bit(VL6180X::SYSALS__INTEGRATION_PERIOD, 50);

  sensor.setTimeout(500);

   // stop continuous mode if already active
  sensor.stopContinuous();
  // in case stopContinuous() triggered a single-shot
  // measurement, wait for it to complete
  delay(300);
  // start interleaved continuous mode with period of 100 ms
  sensor.startInterleavedContinuous(100);

}

void loop()
{
  Serial.print("Ambient: ");
  Serial.print(sensor.readAmbientContinuous());
  if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }

  Serial.print("\tRange: ");
  Serial.print(sensor.readRangeContinuousMillimeters());
  if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }

  Serial.println();
}

sounds like you may have a poor connection
does the I2C scanner show anything?
try plugging the nano into the breadboard with the sensor and using short jumper leads
the sensor you have does not look like any of the Pololu sensors I have - where did you get from? have you a link?

avoid posting images of screen shots - they take a lot a storage, are difficult to read and impossible to copy from

I got it running again. I am going to let it run for a while, and see if it shuts down again.

Thanks,
TT

PS: I bought it on Amazon

Well, It ran for about 2 min and died again. I had it connected to the 5V supply from the NANO. I switched it to the 3V supply, and will try again later on.
Is it possible it is overheating for some reason, or maybe it is just a junk laser.

So it only runs for about 2 min, then stops. Must be a junk sensor. I bought 2 . I will try the second one and see if it lasts longer

Checked the 2nd laser and it didn't work at all. I am returning them and will purchase a TOF10120 laser, and see if I have better luck with it.

Cheers,
TT

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