Hey @Trumany,
I tested 4 different VL6180X sensors with 3 different Jetson Boards - 1 Jetson Nano Dev Kit and 2 different Xavier NX Dev Kits. The case was the same across all tests:
The initial connection to the sensor takes about 10 seconds, once established the data flow is stable and quick.
I made the same test on a Raspberry Pi, with the same sensors and the initial connection to the sensor takes 0.02 seconds. So I think the sensors work fine.
Here is my test code:
import time
import board
import busio
import adafruit_vl6180x # TOF Sensor
class SensorsFeed:
def __init__(self):
self.i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
print("connecting to range sensor...")
self.rng_sensor = adafruit_vl6180x.VL6180X(self.i2c)
print("Sensor online!")
def get_range(self):
sensorVal = self.rng_sensor.range
return sensorVal
if __name__ == "__main__":
start_time = time.time()
sensors = SensorsFeed()
print(f"Took: {time.time() - start_time} sec.")
start_time = time.time()
print("getting measurements")
for i in range(10):
print(sensors.get_range())
print(f"Took: {time.time() - start_time} sec.")
Here is the output on the Jetson (Initial connection takes 10s):
connecting to the range sensor...
Sensor online!
Took: 10.185436964035034 sec.
getting measurements
72
72
73
73
73
70
72
73
69
73
Took: 0.16100001335144043 sec.
Here is the output of the same code on the Raspberry Pi (initial connection takes 0.02s):
connecting to range sensor...
Sensor online!
Took: 0.025896072387695312 sec.
getting measurements
51
51
52
53
54
54
53
54
54
53
Took: 0.11930608749389648 sec.