Easyuino  1.2.0
Easyuino::WaterFlowMeter Class Reference

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>

Inheritance diagram for Easyuino::WaterFlowMeter:
Easyuino::WaterFlowSensor Easyuino::Device

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...
 
- Public Member Functions inherited from Easyuino::WaterFlowSensor
 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...
 
- Public Member Functions inherited from Easyuino::Device
 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

- Protected Attributes inherited from Easyuino::WaterFlowSensor
uint8_t _sensorPin
 Arduino pin connected to the sensor pulse pin.
 
volatile unsigned long _lastPulseTimestamp
 Timestamp with the last time a pulse was detected.
 
- Protected Attributes inherited from Easyuino::Device
bool _isInitialized
 Used to know if the device API is initialized and ready to receive requests.
 

Detailed Description

WaterFlowMeter API extends the WaterFlowSensor API adding the possiblity to know how much water is flowing and how much have flown in total.

See also
Limitation: This allows ONLY 1 instance of WaterFlowMeter per sketch!!
Devices Supported: YF-DN40
Devices Tested: YF-DN40

Constructor & Destructor Documentation

◆ WaterFlowMeter()

Easyuino::WaterFlowMeter::WaterFlowMeter ( IN uint8_t  sensorPin,
IN float  sensorCalibrationFactor 
)

Constructor.

Parameters
sensorPinArduino pin connected to the sensor pulse pin
sensorCalibrationFactorCalibration 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)

Member Function Documentation

◆ begin()

bool Easyuino::WaterFlowMeter::begin ( )
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.

Returns
True: If the device was initialized. False: Otherwise.

Implements Easyuino::Device.

◆ end()

void Easyuino::WaterFlowMeter::end ( )
virtual

Used to stop the device API.

After this the the device will not process API requests.

Implements Easyuino::Device.

◆ getFlowRateLitersMin()

float Easyuino::WaterFlowMeter::getFlowRateLitersMin ( )

Returns the current flow rate that is passing through the flow meter.

Returns
flowRate (Liters/min) The current flow rate.

◆ pulseHandler()

void Easyuino::WaterFlowMeter::pulseHandler ( IN unsigned long  callTimestamp)
protectedvirtual

Called by the interruption ISR for each pulse.

Reimplemented from Easyuino::WaterFlowSensor.


The documentation for this class was generated from the following file: