Class that stores state and functions for interacting with VL53L1X time-of-flight sensor chips.
More...
#include <Adafruit_VL53L1X.h>
Class that stores state and functions for interacting with VL53L1X time-of-flight sensor chips.
◆ Adafruit_VL53L1X()
Adafruit_VL53L1X::Adafruit_VL53L1X |
( |
uint8_t |
shutdown_pin = -1 , |
|
|
uint8_t |
irq_pin = -1 |
|
) |
| |
Create a new VL53L1X instance.
- Parameters
-
shutdown_pin | Optional specify pin attached to shutdown |
irq_pin | Optional specify pin attached to interrupt |
◆ 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_addr | Optional I2C address the sensor can be found on. Default is 0x29 |
theWire | Optional The Wire bus object to use. |
debug | Optional 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
-
ms | Timing 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
-
polarity | The 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.
◆ vl_status
VL53L1X_ERROR Adafruit_VL53L1X::vl_status |
The documentation for this class was generated from the following files: