Simple codes to read distance measurements (in mm) from a TOF10120 LIDAR module. Based on VL53L0X chip. Both of them quite cheap.
Required libraries:
- Wire.h
Codes:
- TOF10120_i2c_V1:
- Version with delays for defining timing. Can be used for different i2c addresses.
- TOF10120_i2c_V2:
- Version with
millis()
for defining timing.
- Version with
- TOF10120_i2c_discardstranges_V1:
- Discard values out of a given range.
- Try to do some lectures before giving the message of "out of range value".
- TOF10120_i2c_average_discardstranges_V1:
- Discard values out of a given range.
- Try to do some lectures before giving the message of "out of range value".
- Perform the average of
NMEASURES
in range measures, giving standard deviation and standard error using 95% Student's coefficient.
Adapted from code of https://surtrtech.com.
You can find the whole information (in Spanish) at Smart Open Lab