touchkey 2.0.0.0
|
Touchkey click has four capacitive pads powered by TTP224, a touchpad detector IC. Capacitive buttons like these can be toggled even when placed under a layer of glass or paper. The board outputs an interrupt signals for each pad: OUTA, OUTB,OUTC and OUTD (in place of default mikroBUS RST, AN, PWM and INT pins, respectively). The TTP224 IC has several operating modes which are accessed through onboard jumpers. Modes include Fast or low power (the response time is just 100mS at fast mode and 200mS at low power). Single-key or multi-key, direct or toggle buttons, and so on.
We provide a library for the TouchKey Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for TouchKey Click driver.
- Initialization function.void touchkey_cfg_setup ( touchkey_cfg_t *cfg );
TOUCHKEY_RETVAL touchkey_init ( touchkey_t *ctx, touchkey_cfg_t *cfg );
void touchkey_default_cfg ( touchkey_t *ctx );
uint8_t touchkey_a ( touchkey_t *ctx );
uint8_t touchkey_b ( touchkey_t *ctx );
uint8_t touchkey_c ( touchkey_t *ctx );
uint8_t touchkey_d ( touchkey_t *ctx );
This application has four capacitive pads powered by TTP224, a touchpad detector IC. Capacitive buttons like these can be toggled even when placed under a layer of glass or paper.
The demo application is composed of two sections :
Initialization driver enables GPIO and also starts write log.
This example demonstrates the use of TouchKey Click board. Detects whether any of the keys is pressed. Results are being sent to the Usart Terminal, where you can track changes.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.