#include <sfeQwiicUltrasonic.h>
◆ sfeQwiicUltrasonic() [1/2]
sfeQwiicUltrasonic::sfeQwiicUltrasonic |
( |
| ) |
|
|
inline |
◆ sfeQwiicUltrasonic() [2/2]
sfeQwiicUltrasonic::sfeQwiicUltrasonic |
( |
const uint8_t |
fwVersion | ) |
|
|
inline |
Alternate constructor.
- Parameters
-
fwVersion | Firmware version of the Qwiic Ultrasonic Sensor. If using an older version of the sensor, the list of available I2C addresses differs. |
◆ begin()
sfeTkError_t sfeQwiicUltrasonic::begin |
( |
sfeTkII2C * |
theBus = nullptr | ) |
|
Begins the Qwiic Ultrasonic sensor.
- Parameters
-
theBus | I2C bus to use for communication |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ changeAddress()
sfeTkError_t sfeQwiicUltrasonic::changeAddress |
( |
uint8_t & |
address | ) |
|
Changes the I2C address of older Qwiic Ultrasonic sensors.
- Parameters
-
address | New address, must be in the range 0x20 to 0x2F |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ getAddress()
uint8_t sfeQwiicUltrasonic::getAddress |
( |
| ) |
|
Gets the current I2C address being used by the library for the Qwiic Ultrasonic sensor.
- Returns
- The current I2C address, 7-bit unshifted
◆ isConnected()
sfeTkError_t sfeQwiicUltrasonic::isConnected |
( |
| ) |
|
Checks if the Qwiic Ultrasonic sensor is connected.
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ triggerAndRead()
sfeTkError_t sfeQwiicUltrasonic::triggerAndRead |
( |
uint16_t & |
distance | ) |
|
Triggers a new measurement and reads the previous one.
- Parameters
-
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ _theBus
sfeTkII2C* sfeQwiicUltrasonic::_theBus |
|
protected |
The documentation for this class was generated from the following files: