propa
Well-known member
Hello again,
I have a VL53L1X breakout, have connected SDA/SCL via 4.7k pullup resistors, but when using the example code I get nothing on the serial monitor, not even the sensor not found. Have tried a couple of libraries now, Pollou and Sparkfun, both with same issue. I have set SDA and SCL pins via the setSDA and setSCL functions in wire. Then tried the libraries with no sensor plugged in, expecting a read out of the serial monitor saying sensor not found, but I'm not getting anything.
The Polou library for the VL53L1X is here: https://github.com/pololu/vl53l1x-arduino
I'm wondering if there's something deeper that I'm missing, maybe these libraries weren't made for Teensy 3.x in mind.
Has anyone got this sensor to work with any 3.x's and care to point me in the right direction?
I thought it was strange to not get a sensor not found pinging back in the serial monitor:
After getting it to work the idea would be to map the sensor data to pitch to investigate it's effectiveness.
I have a VL53L1X breakout, have connected SDA/SCL via 4.7k pullup resistors, but when using the example code I get nothing on the serial monitor, not even the sensor not found. Have tried a couple of libraries now, Pollou and Sparkfun, both with same issue. I have set SDA and SCL pins via the setSDA and setSCL functions in wire. Then tried the libraries with no sensor plugged in, expecting a read out of the serial monitor saying sensor not found, but I'm not getting anything.
The Polou library for the VL53L1X is here: https://github.com/pololu/vl53l1x-arduino
I'm wondering if there's something deeper that I'm missing, maybe these libraries weren't made for Teensy 3.x in mind.
Has anyone got this sensor to work with any 3.x's and care to point me in the right direction?
I thought it was strange to not get a sensor not found pinging back in the serial monitor:
Code:
/*
This example shows how to take simple range measurements with the VL53L1X. The
range readings are in units of mm.
*/
#include <Wire.h>
#include <VL53L1X.h>
VL53L1X sensor;
void setup()
{
Wire.begin();
// Wire.setSDA(38); // SDA1
// Wire.setSCL(37); // SCL1
Wire.setClock(400000); // use 400 kHz I2C
Serial.begin(115200);
delay(200); //
sensor.setTimeout(500);
if (!sensor.init())
{
Serial.println("Failed to detect and initialize sensor!");
while (1);
}
// Use long distance mode and allow up to 50000 us (50 ms) for a measurement.
// You can change these settings to adjust the performance of the sensor, but
// the minimum timing budget is 20 ms for short distance mode and 33 ms for
// medium and long distance modes. See the VL53L1X datasheet for more
// information on range and timing limits.
sensor.setDistanceMode(VL53L1X::Short);
sensor.setMeasurementTimingBudget(50000);
// Start continuous readings at a rate of one measurement every 50 ms (the
// inter-measurement period). This period should be at least as long as the
// timing budget.
sensor.startContinuous(50);
}
void loop()
{
Serial.print(sensor.read());
if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }
Serial.println();
}
After getting it to work the idea would be to map the sensor data to pitch to investigate it's effectiveness.