UART ultrasonic range reader. Call begin() then turnOn(). The driver and serial port must remain alive while receiving or awaiting timeout.
More...
#include <MaxBotix_HRXL_MaxSonar_WR.hpp>
|
|
| MaxBotix_HRXL_MaxSonar_WR (SerialPort &) |
| | Bind the sensor serial port without starting it.
|
| void | begin (void(*func)(MaxBotix_HRXL_MaxSonar_WR &, int16_t mm), uint16_t timeoutMsec) |
| | Configure the receive callback and one-shot timeout.
|
| virtual void | turnOn () |
| | Start 9600-baud listening and arm the one-shot timeout.
|
| virtual void | turnOff () |
| | Stop the timer and UART listening.
|
UART ultrasonic range reader. Call begin() then turnOn(). The driver and serial port must remain alive while receiving or awaiting timeout.
◆ begin()
Configure the receive callback and one-shot timeout.
- Parameters
-
| func | Receives this driver and distance in millimeters, or -1 on timeout; nullptr disables notification. Successful reads do not cancel or restart the timer. |
| timeoutMsec | Timeout in milliseconds, measured from turnOn(). |
◆ turnOff()
| virtual void MaxBotix_HRXL_MaxSonar_WR::turnOff |
( |
| ) |
|
|
inlinevirtual |
Stop the timer and UART listening.
50 {
51 this->timeout.stop();
52 this->s.stopListening();
53 };
◆ turnOn()
| virtual void MaxBotix_HRXL_MaxSonar_WR::turnOn |
( |
| ) |
|
|
inlinevirtual |
Start 9600-baud listening and arm the one-shot timeout.
41 {
42 this->s.begin(9600);
43 this->s.listen();
44 this->timeout.startOneShot(this->timeoutMsec);
45 };
The documentation for this class was generated from the following file: