Easyuino
1.2.0
|
RainDetector API is used to detect the amount of water that is touching the sensor. More...
#include <WaterDetector.h>
Public Member Functions | |
WaterDetector (IN uint8_t digitalPin, IN uint8_t analogPin) | |
Constructor. More... | |
~WaterDetector () | |
Destructor. | |
bool | begin () |
Used to put the device ready to receive requests. More... | |
bool | begin (IN uint8_t digitalPinTriggerLevel) |
Initialize the WaterDetector API putting it ready to receive requests. More... | |
void | end () |
Used to stop the device API. More... | |
WaterStatus | getWaterStatus () |
Returns an enumerate value depending on how wet is the sensor. More... | |
unsigned int | getWaterStatusRange () |
Return a number in [0,1023] depending on dry is the sensor. More... | |
bool | isWaterDetected () |
Used to get the value from the digital pin that is activated when a wet threshold is passed. 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 | |
![]() | |
bool | _isInitialized |
Used to know if the device API is initialized and ready to receive requests. | |
RainDetector API is used to detect the amount of water that is touching the sensor.
Easyuino::WaterDetector::WaterDetector | ( | IN uint8_t | digitalPin, |
IN uint8_t | analogPin | ||
) |
Constructor.
digitalPin | Arduino pin connected to digital pin (Normally D0 in sensor board) |
analogPin | Arduino pin connected to analog pin (Normally A0 in sensor board) |
|
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.
bool Easyuino::WaterDetector::begin | ( | IN uint8_t | digitalPinTriggerLevel | ) |
Initialize the WaterDetector API putting it ready to receive requests.
digitalPinTriggerLevel | The digital level that is triggered in digital pin when water is sensed. |
|
virtual |
Used to stop the device API.
After this the the device will not process API requests.
Implements Easyuino::Device.
WaterStatus Easyuino::WaterDetector::getWaterStatus | ( | ) |
Returns an enumerate value depending on how wet is the sensor.
unsigned int Easyuino::WaterDetector::getWaterStatusRange | ( | ) |
Return a number in [0,1023] depending on dry is the sensor.
Used in getWaterStatus() method.
bool Easyuino::WaterDetector::isWaterDetected | ( | ) |
Used to get the value from the digital pin that is activated when a wet threshold is passed.
Normally the threshold is set using the potentiometer in the water detector board.