Easyuino  1.2.0
Easyuino::WaterFlowSensor Class Reference

WaterFlowSensor is an API offers the ability to know if it is flowing something through the sensor or not using fluid flow meters. More...

#include <WaterFlowSensor.h>

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

Public Member Functions

 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

virtual void pulseHandler (IN unsigned long callTimestamp)
 Called by the interruption ISR for each pulse. More...
 

Protected Attributes

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

WaterFlowSensor is an API offers the ability to know if it is flowing something through the sensor or not using fluid flow meters.

See also
Limitation: Only allows control 1 water flow sensor per sketch
Devices Supported: YF-DN40
Devices Tested: YF-DN40

Constructor & Destructor Documentation

◆ WaterFlowSensor()

Easyuino::WaterFlowSensor::WaterFlowSensor ( IN uint8_t  sensorPin)

Constructor.

Parameters
sensorPinArduino pin connected to the sensor pulse pin

Member Function Documentation

◆ begin()

bool Easyuino::WaterFlowSensor::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::WaterFlowSensor::end ( )
virtual

Used to stop the device API.

After this the the device will not process API requests.

Implements Easyuino::Device.

◆ isFlowing()

bool Easyuino::WaterFlowSensor::isFlowing ( ) const

Checks if there there are flow in the sensor.

Returns
isFlowing True: If there is flow. False: Otherwise.

◆ pulseHandler()

virtual void Easyuino::WaterFlowSensor::pulseHandler ( IN unsigned long  callTimestamp)
protectedvirtual

Called by the interruption ISR for each pulse.

Reimplemented in Easyuino::WaterFlowMeter.


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