⚠️ Very Important: ⚠️ You must power down your Pi before plugging in the electronics for this experiment.
Power down your pi.
Plug in your “T-Cobbler Plus” connector, as shown.
Make sure you get the connector plugged in exactly over the pins as shown! Do not twist the cable/miss any pins, or it will not work.
Connect the wires from the sensor to the breadboard in this configuration:
Pi 3V to sensor VIN (red wire)
Pi GND to sensor GND (black wire)
Pi SCL to sensor SCL (yellow wire)
Pi SDA to sensor SDA (blue wire)
Install this essential library from the command line (terminal) of the Raspberry Pi:
sudo pip3 install adafruit-circuitpython-vl53l1x
if that doesn't work, try:
sudo pip3 install adafruit-circuitpython-vl53l1x --break-system-packages
Open the editor “Thonny Python IDE”
Open the file from your downloaded examples: laser_distance.py
You may want to save a copy so you have the original.
Press “Run” in Thonny.
When you press the button you should see "button pressed" in the debug window.
Press “stop” to stop running the file.
Challenges
Have a light show when someone walks through an invisible beam
Create an empty array that is appended with the distance every time the sensor is triggered