EvoTOF#

class EvoTOF#

Class to interact with the VL53L0X Time-of-Flight (ToF) distance sensor.

Initialisation & Setup

EvoTOF::EvoTOF(I2CChannel channel)#

Constructs an EvoTOF object.

Parameters:

channel – The I2C channel to use.

bool EvoTOF::begin(bool continuous = false)#

Initializes the VL53L0X sensor.

Parameters:

continuous – Sets the sensor in continuous or non-continuous mode if true, the sensor will continuously measure distance at a specified interval.

Returns:

True if the sensor was successfully initialized, false otherwise.

Control Functions

int EvoTOF::getDistance()#

Retrieves the distance measured by the sensor.

Returns:

Distance in millimeters. Returns 2000 when there is an error or when maximum reading range is reached.

int EvoTOF::getDistanceContinuous()#

Retrieves the distance measured by the sensor in continuous mode.

Returns:

Distance in millimeters. Returns 2000 when there is an error or when maximum reading range is reached.

void EvoTOF::setLongRange(bool enable)#

Configures the sensor for long-range measurements.

Parameters:

enable – If true, configures the sensor for long-range mode; otherwise, sets it to default mode.

void EvoTOF::setHighSpeedMode()#

Sets the sensor to high speed mode.

void EvoTOF::setHighAccuracyMode()#

Sets the sensor to high accuracy mode.