upm  0.2.0
Sensor/Actuator repository for libmraa (v0.6.1)
Public Member Functions

C++ API for the Grove Loudness Sensor. More...

Detailed Description

UPM module for the Grove Loudness Sensor. This sensor detects how loud the surrounding environment is. The higher the output analog value, the louder the sound.

// Instantiate a Grove Loudness sensor on analog pin A0
// Print the loudness value every 0.1 seconds
while (shouldRun)
{
int val = loudness->value();
cout << "Loudness value (higher is louder): " << val << endl;
usleep(100000);
}

Public Member Functions

 GroveLoudness (int pin)
 
 ~GroveLoudness ()
 
int value ()
 

Constructor & Destructor Documentation

GroveLoudness ( int  pin)

Grove analog loudness sensor constructor

Parameters
pinanalog pin to use

GroveLoudness Destructor

Member Function Documentation

int value ( )

Get the loudness value from the sensor

Returns
the loudness reading

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