Ultrasonic Sensor Driver (US-016) for XRCU. More...
#include <Uts_us016.h>
Public Member Functions | |
| Uts_us016 (const uint8_t init_ain_channel) | |
| Creates a new Uts_us016 object. | |
| void | set_range_pin_voltage_level (const bool is_vcc=DEFAULT_RANGE_PIN_IS_VCC) |
| Sets whether the Range pin on this ultrasonic sensor is connected to VCC or GND. | |
| uint16_t | read_dist_mm () |
| Reads the distance between this ultrasonic sensor and the obstacle in front of it. | |
Public Member Functions inherited from Uts_general | |
| virtual bool | begin () |
| Activates this ultrasonic sensor. | |
| virtual void | end () |
| Deactivates this ultrasonic sensor. | |
| uint16_t | read_dist_cm () |
| Reads the distance between this ultrasonic sensor and the obstacle in front of it. | |
Additional Inherited Members | |
Protected Member Functions inherited from Uts_general | |
| virtual void | set_beginned (bool is_beginned) |
| Sets whether this ultrasonic sensor is activated. | |
| bool | is_beginned () |
| Checks if this ultrasonic sensor is already activated. | |
| void | store_prev_dist_mm (uint16_t dist_mm) |
| Stores the previous measured distance. | |
| uint16_t | get_prev_dist_mm () |
| Gets the previous measured distance. | |
| Uts_general () | |
| Constructor for a generic ultrasonic sensor driver. | |
Protected Member Functions inherited from Supported_sensor | |
| Supported_sensor () | |
| Creates an object of a supported sensor. | |
Protected Member Functions inherited from Supported_module | |
| Supported_module () | |
| Creates an object of a supported module. | |
Static Protected Attributes inherited from Uts_general | |
| static const uint16_t | ERROR_DIST_MM = 8888 |
| The distance representing a measurement error (in millimeters). | |
Ultrasonic Sensor Driver (US-016) for XRCU.
Ultrasonic Sensor Driver. Analog mode (US-016).
| Uts_us016::Uts_us016 | ( | const uint8_t | init_ain_channel | ) |
Creates a new Uts_us016 object.
| init_ain_channel | the analog input channel hooked up to the ultrasonic sensor |
|
virtual |
Reads the distance between this ultrasonic sensor and the obstacle in front of it.
Reimplemented from Uts_general.
| void Uts_us016::set_range_pin_voltage_level | ( | const bool | is_vcc = DEFAULT_RANGE_PIN_IS_VCC | ) |
Sets whether the Range pin on this ultrasonic sensor is connected to VCC or GND.
| is_vcc | true if the Range pin is connected to VCC, false if the Range pin is connected to GND; leave this parameter blank if the Range pin is not connected to anything |