I am having trouble getting my Garmin LiDAR-Lite V4 (Product ID 4441) to fire up. I am using the sample code below to print the distance in the REPL, however I receive a repeated error message:
Measurement failure
Measurement failure
Measurement failure
Measurement failure
...
I also get the occasional "System failure" message from time to time.
In terms of hardware, I am using a Feather M4 Express with a AP3602A to get 5Vi for the sensor with a 470uF capacitor. My intent is to shrink to a Trinket M0 at some point with a PowerBoost 1000C and maybe an LCD screen).
I am wondering if anyone has any experience with these sensors and may be able to pick up on what I'm missing.
As always, thanks for your help.
Cheers
SlowJim
Code: Select all
import time
import busio
import board
import adafruit_lidarlite
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_lidarlite.LIDARLite(i2c)
while True:
try:
print(sensor.distance)
except RuntimeError as e:
# If we get a reading error, just print it and keep truckin'
print(e)
time.sleep(0.5)