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

API for the TTP223 Touch Sensor. More...

Detailed Description

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
while (true) {
if (touch.isPressed())
System.out.println(touch.name() + " is pressed");
else
System.out.println(touch.name() + " is not pressed");
Thread.sleep(1000);
}

Public Member Functions

synchronized void delete ()
 
 TTP223 (long pin)
 
String name ()
 
int value ()
 
boolean isPressed ()
 
void installISR (int level, IsrCallback cb)
 
void uninstallISR ()
 

Constructor & Destructor Documentation

TTP223 ( long  pin)

TTP223 constructor

Parameters
pinGPIO pin where the sensor is connected

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.
boolean isPressed ( )

Determines whether the touch sensor is being touched

Returns
True if touched, false otherwise
String name ( )

Returns the name of this 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

The documentation for this class was generated from the following file: