Time of Flight sensor data/setup

photon
Tags: #<Tag:0x00007fe21ffe9e18>

#1

Hello. I am working with a Particle Photon and a VL53L0X time of flight sensor from adafruit. I have been trying to figure out how to set up the code and wiring so that I can read the distance values from the sensor. I have downloaded the Visual Studio Code software and imported the VL53L0X library, arduino library, and used some code I found that worked for another user. The data has been flashed to my particle photon, but I am unable to view the sensor data in the serial monitor and terminal. Has anyone else had this problem or would be able to identify where I am going wrong? Thank you!


#2

Firstly, welcome to the Particle Community.

Maybe the first thing to do is ensure that you can get Serial.print() debug output in the serial terminal.

In setup() I assume you have Serial.begin(); and then something like Serial.println("Testing Debug output"); ? To allow time for the Serial port to be opened and connected to it is a good idea to have a short delay delay(5000); or a wait for input while (!Serial.available()) delay(10); You can then move on to work out where the problem(s) are.

Are you sure you have wired it correctly? GND, VIN (3V3), SCL (D1), SDA (D0).


#3

Hi. Thank you for your reply. I first had it wired VIN (VIN), but I changed it according to your suggestion, and I still have the same problem. I am not getting the “Testing Debug output” either. I will include my code:


#4

Update: We figured out how to make the data show up. Apparently I had not clicked the button on the lower right corner that exposed the serial monitor? My teammate was able to figure that out . Thanks!