Reference
Library
Download and install the VL53L3CX Library and Sample Code. (About how to install the library?)
API Description
For more details, please refer to the chapter 4 of the User Manual.
/**********Status**********/
#define VL53LX_RANGESTATUS_RANGE_VALID 0
/*!<The Range is valid. */
#define VL53LX_RANGESTATUS_SIGMA_FAIL 1
/*!<Sigma Fail. */
#define VL53LX_RANGESTATUS_SIGNAL_FAIL 2
/*!<Signal fail. */
#define VL53LX_RANGESTATUS_RANGE_VALID_MIN_RANGE_CLIPPED 3
/*!<Target is below minimum detection threshold. */
#define VL53LX_RANGESTATUS_OUTOFBOUNDS_FAIL 4
/*!<Phase out of valid limits - different to a wrap exit. */
#define VL53LX_RANGESTATUS_HARDWARE_FAIL 5
/*!<Hardware fail. */
#define VL53LX_RANGESTATUS_RANGE_VALID_NO_WRAP_CHECK_FAIL 6
/*!<The Range is valid but the wraparound check has not been done. */
#define VL53LX_RANGESTATUS_WRAP_TARGET_FAIL 7
/*!<Wrapped target - no matching phase in other VCSEL period timing. */
#define VL53LX_RANGESTATUS_PROCESSING_FAIL 8
/*!<Internal algo underflow or overflow in lite ranging. */
#define VL53LX_RANGESTATUS_XTALK_SIGNAL_FAIL 9
/*!<Specific to lite ranging. */
#define VL53LX_RANGESTATUS_SYNCRONISATION_INT 10
/*!<1st interrupt when starting ranging in back to back mode. Ignore data. */
#define VL53LX_RANGESTATUS_RANGE_VALID_MERGED_PULSE 11
/*!<All Range ok but object is result of multiple pulses merging together.
* Used by RQL for merged pulse detection
*/
#define VL53LX_RANGESTATUS_TARGET_PRESENT_LACK_OF_SIGNAL 12
/*!<Used by RQL as different to phase fail. */
#define VL53LX_RANGESTATUS_MIN_RANGE_FAIL 13
/*!<Unexpected error in SPAD Array.*/
#define VL53LX_RANGESTATUS_RANGE_INVALID 14
/*!<lld returned valid range but negative value ! */
#define VL53LX_RANGESTATUS_NONE 255
/**********Count**********/
uint8_t StreamCount;
/*!< 8-bit Stream Count. */
/*#Objs*/
uint8_t NumberOfObjectsFound;
/*!< Indicate the number of objects found.
* This is used to know how many ranging data should be get.
* NumberOfObjectsFound is in the range 0 to
* VL53LX_MAX_RANGE_RESULTS.
*/
/**********D**********/
int16_t RangeMinMilliMeter;
/*!< Tells what is the minimum detection distance of the object
* in current setup and environment conditions (Filled when
* applicable)
*/
/**********Signal**********/
FixPoint1616_t SignalRateRtnMegaCps;
/*!< Return signal rate (MCPS)\n these is a 16.16 fix point
* value, which is effectively a measure of target
* reflectance.
*/
/**********Ambient**********/
FixPoint1616_t AmbientRateRtnMegaCps;
/*!< Return ambient rate (MCPS)\n these is a 16.16 fix point
* value, which is effectively a measure of the ambien
* t light.
*/
Driver
Other Supplementary Information
- The product has only been verified on M0 and ESP32 due to the large size of its algorithm files.
- Multi-target distance measurement can only be triggered under certain conditions. Please refer to their official Web for more details.
- The detection range of 25mm-3000mm comes from the datasheet of STMicroelectronics Rev 2. The actual sensing distance varies with the environment. For measurement environment information, please refer to document AN5561 at the end of Wiki.
Was this article helpful?
