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

API for the Grove Button. More...

Detailed Description

Basic UPM module for the Grove button

// Create the button object using GPIO pin 2
while (true) {
System.out.println(button.name() + " value is " + button.value());
Thread.sleep(1000);
}
grovebutton.jpg

Public Member Functions

synchronized void delete ()
 
 GroveButton (long pin)
 
String name ()
 
int value ()
 
void installISR (int level, IsrCallback cb)
 
void uninstallISR ()
 
- Public Member Functions inherited from Grove
synchronized void delete ()
 
String name ()
 

Constructor & Destructor Documentation

GroveButton ( long  pin)

Grove button constructor

Parameters
gpioPin to use

Member Function Documentation

void installISR ( int  level,
IsrCallback  cb 
)

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.
String name ( )

Gets the name of the sensor

Returns
Name of this sensor
void uninstallISR ( )

Uninstalls the previously installed ISR

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 file: