27 #ifndef _EASYUINO_WATER_FLOW_METER_h 28 #define _EASYUINO_WATER_FLOW_METER_h 30 #include "Utilities.h" 31 #include "WaterFlowSensor.h" 36 #define MIN_TIME_BETWEEN_UPDATES 1000 50 float _sensorCalibrationFactor;
53 float _cachedFlowRate;
55 volatile bool _isDirtyFlowRate;
58 volatile unsigned long _previousMeasurementPulses;
60 volatile unsigned long _previousMeasurementDuration;
63 volatile unsigned long _currentMeasurementPulseCounter;
65 volatile unsigned long _currentMeasurementInitialTimestamp;
73 WaterFlowMeter(IN uint8_t sensorPin, IN
float sensorCalibrationFactor);
void end()
Used to stop the device API.
float getFlowRateLitersMin()
Returns the current flow rate that is passing through the flow meter.
WaterFlowMeter(IN uint8_t sensorPin, IN float sensorCalibrationFactor)
Constructor.
~WaterFlowMeter()
Destructor.
bool begin()
Used to put the device ready to receive requests.
WaterFlowMeter API extends the WaterFlowSensor API adding the possiblity to know how much water is fl...
Definition: WaterFlowMeter.h:46
void pulseHandler(IN unsigned long callTimestamp)
Called by the interruption ISR for each pulse.
WaterFlowSensor is an API offers the ability to know if it is flowing something through the sensor or...
Definition: WaterFlowSensor.h:43