Welcome to Laser Ranging Module repository
1.Laser ranging
1. Learning target
In this course, we will earn how to use Raspberry Pi and laser ranging module to achieve ranging.
2. Preparation
2.1 The laser ranging module uses I2C communication, and connect the SDA and SCL of the module to the SDA and SCL pins of the Raspberry Pi board. VCC and GND are respectively connected to 5V and GND of the Raspberry Pi.
!Tip: Raspberry Pi needs to enable I2C service.
2.2 After the Raspberry Pi I2C is enabled, input command lmusb in the terminal to check whether the I2C is successfully started.
2.3 Download i2c-tools, the software can monitor the usage and faults of hardware devices.
Input command: sudo apt-get install i2c-tools
Input command: i2cdetect -y -a 1 in the terminal.
Check if there is an IIC device: 0x52 or 0x29
3. About code
3.1 Transfer this file into Raspberry Pi system
3.2 Input following command to enter VL53L0X folder.
cd VL53L0X
3.3 Input following command to compile this file.
make
3.4 Input following command to enter python folder.
cd python
3.5Input command to run program
python VL53L0X_example.py
4. Phenomenon
After the program is downloaded successfully, the program will be automatically initialized and calibrated according to the current environment.
Then, the module continuously tests and prints 100 test results through the serial port, the unit is mm and cm.