#include <SparkFun_Qwiic_Ultrasonic_Arduino_Library.h>
◆ begin() [1/2]
sfeTkError_t sfeQwiicUltrasonic::begin |
( |
sfeTkII2C * |
theBus = nullptr | ) |
|
|
inherited |
Begins the Qwiic Ultrasonic sensor.
- Parameters
-
theBus | I2C bus to use for communication |
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ begin() [2/2]
Begins the Qwiic Ultrasonic sensor.
- Parameters
-
address | I2C device address to use for the sensor |
wirePort | Wire port to use for I2C communication |
- Returns
- True if successful, false otherwise
◆ changeAddress()
sfeTkError_t sfeQwiicUltrasonic::changeAddress |
( |
uint8_t & |
address | ) |
|
|
inherited |
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 |
( |
| ) |
|
|
inherited |
Gets the current I2C address being used by the library for the Qwiic Ultrasonic sensor.
- Returns
- The current I2C address, 7-bit unshifted
◆ isConnected()
bool QwiicUltrasonic::isConnected |
( |
| ) |
|
|
inline |
Checks if the Qwiic Ultrasonic sensor is connected.
- Returns
- True if the sensor is connected, false otherwise
◆ triggerAndRead()
sfeTkError_t sfeQwiicUltrasonic::triggerAndRead |
( |
uint16_t & |
distance | ) |
|
|
inherited |
Triggers a new measurement and reads the previous one.
- Parameters
-
- Returns
- 0 for succuss, negative for errors, positive for warnings
◆ _theBus
sfeTkII2C* sfeQwiicUltrasonic::_theBus |
|
protectedinherited |
The documentation for this class was generated from the following file: