upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

API for the Grove Moisture Sensor. More...

Detailed Description

UPM module for the Grove Moisture Sensor. This sensor can be used to detect the moisture content of soil or whether there is water around the sensor. As the moisture content increases, so does the value that is read. Note: this sensor is not designed to be left in soil nor to be used outdoors.

grovemoisture.jpg
while (true) {
int moisture_val = gm.value();
String result;
if (moisture_val >= 0 && moisture_val < 300)
result = "Dry";
else if ((moisture_val >= 0 && moisture_val < 300))
result = "Moist";
else
result = "Wet";
System.out.println("Moisture Value: " + moisture_val + ", " + result);
Thread.sleep(1000);
}

Public Member Functions

synchronized void delete ()
 
 GroveMoisture (int pin)
 
int value ()
 

Constructor & Destructor Documentation

GroveMoisture ( int  pin)

Grove analog moisture sensor constructor

Parameters
pinAnalog pin to use

Member Function Documentation

int value ( )

Gets the moisture value from the sensor

Returns
Moisture reading

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