Teensy 4.0 and Lidar boards mounted
Works with the Trinket M0, this one is brass wired
Arduino Circutpython code running 3 vl53l0x boards to send 3 distance data string to serial-Tested on Adafruit Trinket M0 and Teensy 4.0
Running one vl53l0x with the Python example code is pretty easy but running 2 or more is harder because you have to reset each one and set the I2C address. It loses the address on each reboot so you have to set them every time.
The Teensy 4.0 has many more available pins than the Trinket M0 so 3 vl53l0x boards maxes out the pins on the Trinket but you could add maybe 20 more boards on the Teensy if you wanted. I upgraded to the Teensy to have it read the lidar data but also add in voltage, current and temperature sensors and then just add that data to the data string that's already being sent.
This offloads much of the sensor CPU time so the Raspberry Pi can concentrate on driving the robot.
Detailsarduino_lidar_3.py
Running one vl53l0x with the Python example code is pretty easy but running 2 or more is harder because you have to reset each one and set the I2C address. It loses the address on each reboot so you have to set them every time
chkserial.py
Small Python program to read the USB serial data and print to screen. I used this code on a Raspberry Pi to read the distances from the arduino running the vl53l0x code plugged into the Pi's USB port and drive a robot based on the distance readings.
I used this in another project: Autonomous Cordwood Car
Comments