UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

Button Class

Module: buttonlib
  • 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

Item Index

Methods

Button

(
  • pin
)
Number

button constructor

Parameters:

  • pin Number

    Pin to use

Returns:

Number:

name

() String

Gets the name of the sensor

Returns:

String:

Name of this sensor

value

() Number

Gets the value from the GPIO pin

Returns:

Number:

Value from the GPIO pin

installISR

(
  • level
  • isr
  • arg
)

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

Parameters:

  • level Mraa::Edge

    undefined

  • isr Function

    undefined

  • arg Void *

    Pointer to an object to be supplied as an argument to the ISR.

uninstallISR

()

Uninstalls the previously installed ISR