Easyuino
1.2.0
|
It offers the same API as DistanceMeter plus some methods to print the internal state into a stream for example. More...
#include <DistanceMeterPrintable.h>
Public Member Functions | |
DistanceMeterPrintable (IN uint8_t triggerPin, IN uint8_t echoPin) | |
Constructor similar to the DistanceMeter one. More... | |
~DistanceMeterPrintable () | |
Destructor. | |
char * | toString () const |
Used to return a string representation of the object state. More... | |
![]() | |
DistanceMeter (IN uint8_t triggerPin, IN uint8_t echoPin) | |
Constructor. More... | |
DistanceMeter (IN uint8_t triggerEchoPin) | |
Contructor used with Ultrasonic Modules that have only one pin for trigger and echo. More... | |
~DistanceMeter () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
void | end () |
Used to stop the device API. More... | |
virtual float | getDistanceCentimeters () |
Gets the last value that the API measured using the Ultrasonic Module. More... | |
float | getDistanceInches () |
Gets the last value that the API measured using the US. More... | |
virtual void | updateDistance () |
Updates the distance of the Ultrasonic Module to the objects in a blocking way. More... | |
![]() | |
Device () | |
Constructor called by every sub-classes. | |
~Device () | |
Destroy all the resources associated with the device. | |
bool | isInitialized () const |
Verify is the device is initialized and ready to use. More... | |
Additional Inherited Members | |
![]() | |
float | executeUpdateDistanceBlock (IN float soundSpeed) |
Execute a block distance measurement and calculates the distance based on the sound speed. More... | |
![]() | |
uint8_t | _triggerPin |
Arduino pin used to trigger the echo wave emission. | |
uint8_t | _echoPin |
Arduino pin that is set to LOW by when reflected echo wave arrives. | |
volatile bool | _isEchoing |
Used to know if it is in a middle of a measurement. | |
volatile float | _distance |
It contains a cached value of the last distance measured. More... | |
![]() | |
bool | _isInitialized |
Used to know if the device API is initialized and ready to receive requests. | |
It offers the same API as DistanceMeter plus some methods to print the internal state into a stream for example.
Useful for debugging purposes.
Easyuino::DistanceMeterPrintable::DistanceMeterPrintable | ( | IN uint8_t | triggerPin, |
IN uint8_t | echoPin | ||
) |
Constructor similar to the DistanceMeter one.
triggerPin | Arduino pin connected to the trigger pin of the Ultrasonic Module |
echoPin | Arduino pin connected to the echo pin of the Ultrasonic Module |
|
virtual |
Used to return a string representation of the object state.
IMPORTANT: It is mandatory to free the returned pointer in order to have no memory leaks.
Implements Easyuino::Printable.