Ultrasonic Sensor Driver (UART) for XRCU. More...
#include <Uts_uart.h>
Public Member Functions | |
| Uts_uart (const uint8_t port) | |
| Creates a new Uts_uart object. | |
| Uts_uart (HardwareSerial &init_serial) | |
| Creates a new Uts_uart object. | |
| bool | begin () |
| Activates this ultrasonic sensor. | |
| void | end () |
| Deactivates this ultrasonic sensor. | |
Public Member Functions inherited from Uts_togglable | |
| virtual void | disable () |
| Teporarily disables this ultrasonic sensor. | |
| virtual void | enable () |
| Re-enables this ultrasonic sensor. | |
Public Member Functions inherited from Uts_general | |
| virtual uint16_t | read_dist_mm () |
| Reads the distance between this ultrasonic sensor and the obstacle in front of it. | |
| 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_togglable | |
| void | set_beginned (bool is_beginned) |
| Sets whether this ultrasonic sensor is activated. | |
| void | set_enabled (bool is_enabled) |
| Sets whether this ultrasonic sensor is enabled or not. | |
| bool | is_enabled () |
| Checks if this ultrasonic sensor is enabled or not. | |
| Uts_togglable () | |
| Constructor for a togglable ultrasonic sensor driver. | |
Protected Member Functions inherited from Uts_general | |
| 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 (UART) for XRCU.
Ultrasonic Sensor Driver. UART mode.
| Uts_uart::Uts_uart | ( | const uint8_t | port | ) |
Creates a new Uts_uart object.
| init_port | the UART port connected to this ultrasonic sensor |
| Uts_uart::Uts_uart | ( | HardwareSerial & | init_serial | ) |
Creates a new Uts_uart object.
| init_serial | the UART object connected to this ultrasonic sensor (e.g. Uart6) |
|
virtual |
Activates this ultrasonic sensor.
YOU MUST CALL ME IN void setup () FUNCTION TO USE THIS OBJECT PROPERLY. Configures the settings of the pin mode(s), possible communication bus(es) and this ultrasonic sensor.
true if sensor is successfully activated, false otherwise Reimplemented from Uts_togglable.
|
virtual |
Deactivates this ultrasonic sensor.
Releases the communication pins and ports and clears the memory used for this ultrasonic sensor.
Reimplemented from Uts_togglable.