69 #define ALGO__PART_TO_PART_RANGE_OFFSET_MM 0x001E 70 #define MM_CONFIG__INNER_OFFSET_MM 0x0020 71 #define MM_CONFIG__OUTER_OFFSET_MM 0x0022 84 for (i = 0; i < 50; i++) {
91 AverageDistance = AverageDistance + distance;
94 AverageDistance = AverageDistance / 50;
95 *offset = TargetDistInMm - AverageDistance;
103 float AverageSignalRate = 0;
104 float AverageDistance = 0;
105 float AverageSpadNb = 0;
113 for (i = 0; i < 50; i++) {
121 AverageDistance = AverageDistance + distance;
123 AverageSpadNb = AverageSpadNb + spadNum;
125 AverageSignalRate + sr;
128 AverageDistance = AverageDistance / 50;
129 AverageSpadNb = AverageSpadNb / 50;
130 AverageSignalRate = AverageSignalRate / 50;
132 calXtalk = (
uint16_t)(512*(AverageSignalRate*(1-(AverageDistance/TargetDistInMm)))/AverageSpadNb);
133 *xtalk = (
uint16_t)(calXtalk*1000)>>9;
VL53L1X_ERROR VL53L1X_StopRanging(uint16_t dev)
This function stops the ranging.
VL53L1X_ERROR VL53L1X_StartRanging(uint16_t dev)
This function starts the ranging distance operation The ranging operation is continuous. The clear interrupt has to be done after each get data to allow the interrupt to raise when the next data is ready 1=active high (default), 0=active low, use SetInterruptPolarity() to change the interrupt polarity if required.
signed char int8_t
Typedef defining 8 bit char type. The developer should modify this to suit the platform being deploye...
#define MM_CONFIG__OUTER_OFFSET_MM
short int16_t
Typedef defining 16 bit short type. The developer should modify this to suit the platform being deplo...
int8_t VL53L1X_CalibrateXtalk(uint16_t dev, uint16_t TargetDistInMm, uint16_t *xtalk)
This function performs the xtalk calibration. The function returns the xtalk value found and programs...
VL53L1X_ERROR VL53L1X_GetSignalRate(uint16_t dev, uint16_t *signal)
This function returns the returned signal in kcps.
VL53L1X_ERROR VL53L1X_GetDistance(uint16_t dev, uint16_t *distance)
This function returns the distance measured by the sensor in mm.
#define ALGO__PART_TO_PART_RANGE_OFFSET_MM
VL53L1X_ERROR VL53L1X_GetSpadNb(uint16_t dev, uint16_t *spNb)
This function returns the current number of enabled SPADs.
int8_t VL53L1X_CalibrateOffset(uint16_t dev, uint16_t TargetDistInMm, int16_t *offset)
This function performs the offset calibration. The function returns the offset value found and progra...
#define MM_CONFIG__INNER_OFFSET_MM
VL53L1X_ERROR VL53L1X_CheckForDataReady(uint16_t dev, uint8_t *isDataReady)
This function checks if the new ranging data is available by polling the dedicated register...
VL53L1X_ERROR VL53L1X_ClearInterrupt(uint16_t dev)
This function clears the interrupt, to be called after a ranging data reading to arm the interrupt fo...
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
unsigned int uint32_t
Typedef defining 32 bit unsigned int type. The developer should modify this to suit the platform bein...