upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the Grove Water Sensor. More...

Detailed Description

Deprecated:
This class is being replaced by Water

UPM module for the Grove Water sensor

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

Public Member Functions

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

Constructor & Destructor Documentation

GroveWater ( int  pin)

Grove digital water sensor constructor

Parameters
pinDigital pin to use
~GroveWater ( )

GroveWater destructor

Member Function Documentation

bool isWet ( )

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

Returns
True if the sensor is wet, false otherwise

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