upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
WaterLevel Class Reference

UPM module for the Grove Water Level Switch. More...

Detailed Description

This switch is a device used to sense the level of liquid within a tank, it may actuate a pump, an indicator, an alarm, or other devices.

waterlevel.jpg
// Instantiate a Grove Luminance sensor on analog pin A0
upm::APDS9002* luminance = new upm::APDS9002(0);
while (shouldRun)
{
int val = luminance->value();
cout << "Luminance value is " << val << endl;
sleep(1);
}

Public Member Functions

 WaterLevel (int pin)
 
 ~WaterLevel ()
 
bool isSubmerged ()
 

Constructor & Destructor Documentation

WaterLevel ( int  pin)

WaterLevel constructor

Parameters
pinDigital pin to use
~WaterLevel ( )

WaterLevel destructor

Member Function Documentation

bool isSubmerged ( )
Returns
bool Determines whether liquid has risen above the sensor

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