Adafruit Library
Public Member Functions | Public Attributes | List of all members
Adafruit_VL53L1X Class Reference

Class that stores state and functions for interacting with VL53L1X time-of-flight sensor chips. More...

#include <Adafruit_VL53L1X.h>

Inheritance diagram for Adafruit_VL53L1X:

Public Member Functions

 Adafruit_VL53L1X (uint8_t shutdown_pin=-1, uint8_t irq_pin=-1)
 Create a new VL53L1X instance. More...
 
bool begin (uint8_t i2c_addr=VL53L1X_I2C_ADDR, TwoWire *theWire=&Wire, bool debug=false)
 Setups the I2C interface and hardware. More...
 
uint16_t sensorID (void)
 Get the sensor ID. More...
 
bool startRanging (void)
 Start ranging operations. More...
 
bool stopRanging (void)
 Stop ranging operations. More...
 
bool setTimingBudget (uint16_t ms)
 Set the timing budget. More...
 
uint16_t getTimingBudget (void)
 Get the timing budget. More...
 
bool dataReady (void)
 Check status of new data. More...
 
int16_t distance (void)
 Get the distance. More...
 
bool clearInterrupt (void)
 Clear the interrupt. More...
 
bool setIntPolarity (bool polarity)
 Set the interrupt polarity. More...
 
bool getIntPolarity (void)
 Get the interrupt polarity. More...
 

Public Attributes

VL53L1X_ERROR vl_status
 

Detailed Description

Class that stores state and functions for interacting with VL53L1X time-of-flight sensor chips.

Constructor & Destructor Documentation

◆ Adafruit_VL53L1X()

Adafruit_VL53L1X::Adafruit_VL53L1X ( uint8_t  shutdown_pin = -1,
uint8_t  irq_pin = -1 
)

Create a new VL53L1X instance.

Parameters
shutdown_pinOptional specify pin attached to shutdown
irq_pinOptional specify pin attached to interrupt

Member Function Documentation

◆ begin()

bool Adafruit_VL53L1X::begin ( uint8_t  i2c_addr = VL53L1X_I2C_ADDR,
TwoWire *  theWire = &Wire,
bool  debug = false 
)

Setups the I2C interface and hardware.

Parameters
i2c_addrOptional I2C address the sensor can be found on. Default is 0x29
theWireOptional The Wire bus object to use.
debugOptional debug flag. If true, debug information will print out via Serial.print during setup. Defaults to false.
Returns
True if device is set up, false on any failure

◆ sensorID()

uint16_t Adafruit_VL53L1X::sensorID ( void  )

Get the sensor ID.

Returns
The sensor ID.

◆ startRanging()

bool Adafruit_VL53L1X::startRanging ( void  )

Start ranging operations.

Returns
True if successful, otherwise false.

◆ stopRanging()

bool Adafruit_VL53L1X::stopRanging ( void  )

Stop ranging operations.

Returns
True if successful, otherwise false.

◆ setTimingBudget()

bool Adafruit_VL53L1X::setTimingBudget ( uint16_t  ms)

Set the timing budget.

Parameters
msTiming budget in milliseconds.
Returns
True if successful, otherwise false.

◆ getTimingBudget()

uint16_t Adafruit_VL53L1X::getTimingBudget ( void  )

Get the timing budget.

Returns
Timing budget in milliseconds.

◆ dataReady()

bool Adafruit_VL53L1X::dataReady ( void  )

Check status of new data.

Returns
True if new data available, otherwise false.

◆ distance()

int16_t Adafruit_VL53L1X::distance ( void  )

Get the distance.

Returns
The distance.

◆ clearInterrupt()

bool Adafruit_VL53L1X::clearInterrupt ( void  )

Clear the interrupt.

Returns
True if successful, otherwise false.

◆ setIntPolarity()

bool Adafruit_VL53L1X::setIntPolarity ( bool  polarity)

Set the interrupt polarity.

Parameters
polarityThe polarity to set as a boolean.
Returns
True if successful, otherwise false.

◆ getIntPolarity()

bool Adafruit_VL53L1X::getIntPolarity ( void  )

Get the interrupt polarity.

Returns
Polarity as a boolean.

Member Data Documentation

◆ vl_status

VL53L1X_ERROR Adafruit_VL53L1X::vl_status

VL53L1X API Error Status


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