upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the TTP223 Touch Sensor. More...
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.
Public Member Functions | |
TTP223 (unsigned int pin) | |
~TTP223 () | |
std::string | name () |
int | value () |
bool | isPressed () |
void | installISR (mraa::Edge level, void(*isr)(void *), void *arg) |
void | uninstallISR () |
Protected Attributes | |
std::string | m_name |
name of this sensor | |
mraa_gpio_context | m_gpio |
GPIO pin. | |
bool | m_isrInstalled |
std::string name | ( | ) |
Returns the name of this sensor
int value | ( | ) |
Gets the value from the GPIO pin
bool isPressed | ( | ) |
Determines whether the touch sensor is being touched
void installISR | ( | mraa::Edge | level, |
void(*)(void *) | isr, | ||
void * | arg | ||
) |
Installs an interrupt service routine (ISR) to be called when the button is activated or deactivated.
isr | Pointer to a function to be called on interrupt |
arg | Pointer to an object to be supplied as an argument to the ISR. |
void uninstallISR | ( | ) |
Uninstalls the previously installed ISR