Easyuino
1.2.0
|
WaterFlowMeter API extends the WaterFlowSensor API adding the possiblity to know how much water is flowing and how much have flown in total. More...
#include <WaterFlowMeter.h>
Public Member Functions | |
WaterFlowMeter (IN uint8_t sensorPin, IN float sensorCalibrationFactor) | |
Constructor. More... | |
~WaterFlowMeter () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
void | end () |
Used to stop the device API. More... | |
float | getFlowRateLitersMin () |
Returns the current flow rate that is passing through the flow meter. More... | |
![]() | |
WaterFlowSensor (IN uint8_t sensorPin) | |
Constructor. More... | |
~WaterFlowSensor () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
void | end () |
Used to stop the device API. More... | |
bool | isFlowing () const |
Checks if there there are flow in the sensor. 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... | |
Protected Member Functions | |
void | pulseHandler (IN unsigned long callTimestamp) |
Called by the interruption ISR for each pulse. More... | |
Additional Inherited Members | |
![]() | |
uint8_t | _sensorPin |
Arduino pin connected to the sensor pulse pin. | |
volatile unsigned long | _lastPulseTimestamp |
Timestamp with the last time a pulse was detected. | |
![]() | |
bool | _isInitialized |
Used to know if the device API is initialized and ready to receive requests. | |
WaterFlowMeter API extends the WaterFlowSensor API adding the possiblity to know how much water is flowing and how much have flown in total.
Easyuino::WaterFlowMeter::WaterFlowMeter | ( | IN uint8_t | sensorPin, |
IN float | sensorCalibrationFactor | ||
) |
Constructor.
sensorPin | Arduino pin connected to the sensor pulse pin |
sensorCalibrationFactor | Calibration factor that comes with the sensor specs, necessary for a good calculation of the flow rate and the total amount flowed (e.g: 0.2 in case of YF-DN40) |
|
virtual |
Used to put the device ready to receive requests.
Normally this have some default behaviour some devices have other overload method with same name that receives other arguments to device customization.
Implements Easyuino::Device.
|
virtual |
Used to stop the device API.
After this the the device will not process API requests.
Implements Easyuino::Device.
float Easyuino::WaterFlowMeter::getFlowRateLitersMin | ( | ) |
Returns the current flow rate that is passing through the flow meter.
|
protectedvirtual |
Called by the interruption ISR for each pulse.
Reimplemented from Easyuino::WaterFlowSensor.