ESP32-CAM With VL53L1X Distance Sensor

jcdrbre4
Posts: 2
Joined: Sun Apr 18, 2021 6:08 am

ESP32-CAM With VL53L1X Distance Sensor

Postby jcdrbre4 » Sun Apr 18, 2021 6:16 am

Has anyone got the combination of the ESP32-CAM and VL53L1X to work?

I'm trying to re-define the I2C pins to 14 and 15 but with no success using the SparkFun_VL53L1X.h library. Is it possible to redefine the SDA and SCL pins using this library?

Here are the relevant parts of my code:

Code: Select all

#include <Wire.h>
#include "SparkFun_VL53L1X.h"

SFEVL53L1X distanceSensor;

const int I2C_SDA = 14;
const int I2C_SCL = 15;

void setup() {

  Wire.begin(I2C_SDA,I2C_SCL);

  distanceSensor.setDistanceModeShort();

}

void loop() {

  distanceSensor.startRanging();
  int distance = distanceSensor.getDistance();
  distanceSensor.stopRanging();

  debugV("Distance (mm) %u",distance);

}



Who is online

Users browsing this forum: No registered users and 66 guests