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

API for the Grove Button. More...

Detailed Description

Deprecated:
This class is being replaced by the upm-button library and the Button class.

Basic UPM module for the Grove button

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

Public Member Functions

 GroveButton (unsigned int pin)
 
 ~GroveButton ()
 
std::string name ()
 
int value ()
 
void installISR (mraa::Edge level, void(*isr)(void *), void *arg)
 
void uninstallISR ()
 
- 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
pinPin 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
void installISR ( mraa::Edge  level,
void(*)(void *)  isr,
void *  arg 
)

Installs an interrupt service routine (ISR) to be called when the button is activated or deactivated.

Parameters
fptrPointer to a function to be called on interrupt
argPointer to an object to be supplied as an argument to the ISR.

Here is the call graph for this function:

void uninstallISR ( )

Uninstalls the previously installed ISR

Here is the caller graph for this function:

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: