upm  0.3.2
Sensor/Actuator repository for libmraa (v0.7.2)
Public Member Functions

API for the Grove Button. More...

Detailed Description

Basic UPM module for the Grove button

// Create the button object using GPIO pin 0
// Read the input and print, waiting one second between readings
while( 1 ) {
std::cout << button->name() << " value is " << button->value() << std::endl;
sleep(1);
}
// Delete the button object
delete button;
grovebutton.jpg

Public Member Functions

 GroveButton (unsigned int pin)
 
 ~GroveButton ()
 
std::string name ()
 
int value ()
 
- Public Member Functions inherited from Grove
std::string name ()
 

Additional Inherited Members

- Protected Attributes inherited from Grove
std::string m_name
 

Constructor & Destructor Documentation

GroveButton ( unsigned int  pin)

Grove button constructor

Parameters
gpioPin to use

Grove button destructor

Member Function Documentation

std::string name ( )

Gets the name of the sensor

Returns
Name of this sensor
int value ( )

Gets the value from the GPIO pin

Returns
Value from the GPIO pin
Inheritance diagram for GroveButton:
Inheritance graph
[legend]
Collaboration diagram for GroveButton:
Collaboration graph
[legend]

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