MRMS
Public Types | Public Member Functions | List of all members
VL53L1Xs Class Reference

Public Types

enum  RangeProfile { ShortRange , MidRange , LongRange }
 

Public Member Functions

 VL53L1Xs (HardwareSerial *hardwareSerial=0, bool displayWarnings=false)
 
 ~VL53L1Xs ()
 
void add (uint8_t pin=0xFF, uint8_t i2c_addr=0x29)
 
void begin (boolean verbose=false)
 
uint16_t distance (uint8_t sensorNumber)
 
void rangeProfileSet (RangeProfile value, uint8_t sensorNumber=0xFF)
 
void roi (uint8_t sensorNumber=0xFF, uint8_t TopLeftX=0, uint8_t TopLeftY=15, uint8_t BottomRightX=15, uint8_t BottomRightY=0)
 
void roiCenter (uint8_t sensorNumber, uint8_t &xCenter, uint8_t &yCenter)
 
void stress (BreakCondition breakWhen=0)
 
void test (BreakCondition breakWhen=0)
 

Member Enumeration Documentation

◆ RangeProfile

Short range - 1.3 m Middle range - 3 m Long range - 4 m

Constructor & Destructor Documentation

◆ VL53L1Xs()

VL53L1Xs::VL53L1Xs ( HardwareSerial *  hardwareSerial = 0,
bool  displayWarnings = false 
)

Constructor

Parameters
hardwareSerial- optional additional serial port, for example for Bluetooth.
displayWarnings- display ranging warnings.

◆ ~VL53L1Xs()

VL53L1Xs::~VL53L1Xs ( )

Destructor

Destructor

Parameters
displayWarnings- display ranging warnings.

Member Function Documentation

◆ add()

void VL53L1Xs::add ( uint8_t  pin = 0xFF,
uint8_t  i2c_addr = 0x29 
)

Add a sensor. It assigns sensor 0 to the first sensor, 1 to the second, etc. This number ("sensorNumber") is used to call other functions for this sensor.

Parameters
pin- Sensor's enable pin.
pin- Sensor's enable pin. 0xFF - not used. Sensor will be enabled if this pin if left unconnected due to internal pull-up.
i2c_add- I2C address. 0x29 must not be used to any other I2C device, even if not used for any VL53L1X.

Add a sensor. It assigns sensor 0 to the first sensor, 1 to the second, etc. This number ("sensorNumber") is used to call other functions for this sensor.

Parameters
pin- Sensor's enable pin.
pin- Sensor's enable pin. 0xFF - not used. Sensor will be enabled if this pin if left unconnected due to internal pull-up.
i2c_addr- I2C address. 0x29 must not be used to any other I2C device, even if not used for any VL53L1X.

◆ begin()

void VL53L1Xs::begin ( boolean  verbose = false)

Starts sensors. It must be called after all the add() calls.

Parameters
continuousMeasurement- Non-stop measuring.
verbose- Detailed display.

Starts sensors. It must be called after all the add() calls.

Parameters
verbose- Detailed display.

◆ distance()

uint16_t VL53L1Xs::distance ( uint8_t  sensorNumber)

Distance measurement

Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0.
Returns
- Distance in mm.

◆ rangeProfileSet()

void VL53L1Xs::rangeProfileSet ( RangeProfile  value,
uint8_t  sensorNumber = 0xFF 
)

Ranging profile

Parameters
value- profile
sensorNumber- Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. 0xFF - all sensors.

◆ roi()

void VL53L1Xs::roi ( uint8_t  sensorNumber = 0xFF,
uint8_t  TopLeftX = 0,
uint8_t  TopLeftY = 15,
uint8_t  BottomRightX = 15,
uint8_t  BottomRightY = 0 
)

Region of interest, can used to set FOV (field of view). The minimum ROI size is 4x4, maximum (and default) 16x16. Use roiCenter() to find center.

Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. 0xFF - all sensors.
TopLeftX- top left X of the FOV, 0-15.
TopLeftY- top left X of the FOV, 0-15.
BottomRightX- bottom right X of the FOV, 0-15.
BottomRightY- bottom right X of the FOV, 0-15.

Region of interest, can used to set FOV (field of view). The minimum ROI size is 4x4, maximum (and default) 16x16.

Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0.
TopLeftX- top left X of the FOV, 0-15.
TopLeftY- top left X of the FOV, 0-15.
BottomRightX- bottom right X of the FOV, 0-15.
BottomRightY- bottom right X of the FOV, 0-15.

◆ roiCenter()

void VL53L1Xs::roiCenter ( uint8_t  sensorNumber,
uint8_t xCenter,
uint8_t yCenter 
)

ROI center. Due to assembly tolerances, the optical center of the device can vary.

Parameters
xCenter- returns center's x coordinate, 0-15.
yCenter- returns center's y coordinate, 0-15.

◆ stress()

void VL53L1Xs::stress ( BreakCondition  breakWhen = 0)

Stress test

Parameters
breakWhen- A function returning bool, without arguments. If it returns true, the stress() will be interrupted.

◆ test()

void VL53L1Xs::test ( BreakCondition  breakWhen = 0)

Test

Parameters
breakWhen- A function returning bool, without arguments. If it returns true, the test() will be interrupted.

The documentation for this class was generated from the following files: