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.

TTP223 Class

Module: ttp223

This touch sensor detects when a finger is near the metallic pad by the change in capacitance. It can replace a more traditional push button. The touch sensor can still function when placed under a non-metallic surface like glass or plastic.
ttp223.jpg

Methods

TTP223

(
  • pin
)
Number

TTP223 constructor

Parameters:

  • pin Number

    GPIO pin where the sensor is connected

Returns:

Number:

name

() String

Returns the name of this sensor

Returns:

String:

Name of this sensor

value

() Number

Gets the value from the GPIO pin

Returns:

Number:

Value from the GPIO pin

isPressed

() Boolean

Determines whether the touch sensor is being touched

Returns:

Boolean:

True if touched, false otherwise

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

    Pointer to a function to be called on interrupt

  • arg Void *

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

uninstallISR

()

Uninstalls the previously installed ISR