upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs

Button library. More...

Data Structures

struct  _button_context
 API for the Button. More...
 
class  Button
 API for the Button. More...
 

Typedefs

typedef struct _button_contextbutton_context
 API for the Button. More...
 

Detailed Description

Typedef Documentation

typedef struct _button_context * button_context
  • ID: button
  • Name: Button
  • Other Names: Grove Button
  • Category: button
  • Manufacturer: seeed
  • Connection: gpio
  • Kit: gsk

Basic UPM module for the button sensor

button.jpg
// Create the button object using GPIO pin 0
upm::Button* button = new upm::Button(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;
Collaboration diagram for libupm-button: