Hi OpenMV Support:
I was able to confirm that using the ARDUINO IDE programmed in C language the ARDUINO NICLA VISION ToF VL53L1X SENSOR does not freeze the distance reading suddenly. Works perfectly smoothly
Now, if I do the program with the OpenMV IDE in micropython it suddenly fails and stops reading the distance.
Can it be a problem of libraries?
Can you help me with this problem?
I leave below the code used
import time
from pyb import LED
from vl53l1x import VL53L1X
from machine import Pin, I2C
led = Pin("LED_GREEN", Pin.OUT)
tof = VL53L1X(I2C(2))
while True:
distance = tof.read()
print(f"Distance: {distance}mm")
if distance >= 1100:
led.on() # Enciende el LED interno
else:
led.off() # Apaga el LED interno
time.sleep_ms(50)
Best Regards.