#include <SparkFun_Qwiic_Ultrasonic_Arduino_Library.h>
◆ begin() [1/2]
sfTkError_t sfDevUltrasonicDist::begin |
( |
sfTkII2C * |
theBus = nullptr | ) |
|
|
inherited |
Begins the Qwiic Ultrasonic sensor.
- Parameters
-
theBus | I2C bus to use for communication |
- Returns
- 0 for success, negative for errors, positive for warnings
◆ begin() [2/2]
Begins the Qwiic Ultrasonic sensor.
This method initializes the Qwiic Ultrasonic sensor by setting up the I2C bus and starting communication with the 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()
sfTkError_t sfDevUltrasonicDist::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 sfDevUltrasonicDist::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.
This method verifies if the Qwiic Ultrasonic sensor is properly connected by checking the communication status.
- Returns
- True if the sensor is connected, false otherwise
◆ triggerAndRead()
sfTkError_t sfDevUltrasonicDist::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
sfTkII2C* sfDevUltrasonicDist::_theBus |
|
protectedinherited |
The documentation for this class was generated from the following file: