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
GroveWater Class Reference

API for the Grove Water Sensor. More...

Detailed Description

UPM module for the Grove Water sensor

// Instantiate a Grove Water sensor on digital pin D2
while (shouldRun)
bool val = water->isWet();
if (val)
cout << "Sensor is wet." << endl;
cout << "Sensor is dry." << endl;

Public Member Functions

 GroveWater (int pin)
 ~GroveWater ()
bool isWet ()

Constructor & Destructor Documentation

GroveWater ( int  pin)

Grove digital water sensor constructor

pinDigital pin to use
~GroveWater ( )

GroveWater destructor

Member Function Documentation

bool isWet ( )

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

True if the sensor is wet, false otherwise

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