upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
Water Class Reference

API for the Water Sensor. More...

Detailed Description

UPM module for the Water sensor

water.jpg
// Instantiate a Water sensor on digital pin D2
upm::Water* water = new upm::Water(2);
while (shouldRun)
{
bool val = water->isWet();
if (val)
cout << "Sensor is wet." << endl;
else
cout << "Sensor is dry." << endl;
sleep(1);
}

Public Member Functions

 Water (unsigned int pin)
 
 ~Water ()
 
bool isWet ()
 

Constructor & Destructor Documentation

Water ( unsigned int  pin)

digital water sensor constructor

Parameters
pinDigital pin to use
~Water ( )

Water destructor

Here is the call graph for this function:

Member Function Documentation

bool isWet ( )

Gets the water (wet/not wet) value from the sensor

Returns
True if the sensor is wet, false otherwise

Here is the call graph for this function:


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