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

Public Types

enum  RangeProfile { DefaultMode , HighAccuracy , LongRange , HighSpeed }
 

Public Member Functions

 VL53L0Xs (HardwareSerial *hardwareSerial=0)
 
void add (uint8_t pin, uint8_t i2c_addr=0x29)
 
void begin (bool continuousMeasurement=true, boolean verbose=false, uint8_t sensorNumber=0xFF)
 
uint16_t distance (uint8_t sensorNumber, bool average=false)
 
void rangeProfileSet (RangeProfile value, uint8_t sensorNumber=0xFF)
 
void reset (uint8_t sensorNumber=0xFF)
 
void test (BreakCondition breakWhen=0, bool average=false)
 

Member Enumeration Documentation

◆ RangeProfile

Default mode: 30ms budget 1.2m, accuracy as per Table 12 in data sheet. High accuracy: 200ms budget 1.2m, accuracy < +/- 3% precise measurement. Long range: 33ms budget 2m, long ranging, only for dark conditions (no IR). High speed: 20ms budget 1.2m, accuracy +/- 5% high speed where accuracy is not priority.

Constructor & Destructor Documentation

◆ VL53L0Xs()

VL53L0Xs::VL53L0Xs ( HardwareSerial *  hardwareSerial = 0)

Constructor

Parameters
hardwareSerial- optional additional serial port, for example for Bluetooth.

Member Function Documentation

◆ add()

void VL53L0Xs::add ( uint8_t  pin,
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_addr- I2C address. 0x29 must not be used to any other I2C device, even if not used for any VL53L1X.

◆ begin()

void VL53L0Xs::begin ( bool  continuousMeasurement = true,
boolean  verbose = false,
uint8_t  sensorNumber = 0xFF 
)

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

Parameters
continuousMeasurement- Non-stop measuring.
verbose- Detailed display.
sensorNumber- Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0.

◆ distance()

uint16_t VL53L0Xs::distance ( uint8_t  sensorNumber,
bool  average = false 
)

Distance measurement

Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0.
average- if true, average measurement. Sample count is defined by using SAMPLE_COUNT_AVG.
Returns
- Distance in mm.

◆ rangeProfileSet()

void VL53L0Xs::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.

◆ reset()

void VL53L0Xs::reset ( uint8_t  sensorNumber = 0xFF)

Reset

Parameters
sensorNumber- sensor number. 0xFF - all the sensors.

◆ test()

void VL53L0Xs::test ( BreakCondition  breakWhen = 0,
bool  average = false 
)

Test

Parameters
breakWhen- A function returning bool, without arguments. If it returns true, the test() will be interrupted.
average- if true, average measurement. Sample count is defined by using SAMPLE_COUNT_AVG.

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