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.

GroveButton Class

Module: grove
  • ID: grovebutton
  • Name: Button
  • Other Names: Grove Touch Sensor
  • Category: button touch
  • Manufacturer: seeed
  • Connection: gpio
  • Kit: gsk

Basic UPM module for the Grove button
grovebutton.jpg

Methods

GroveButton

(
  • pin
)
Number

Grove 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