We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-12-17
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Capacitive
Downloaded: 2036 times
Not followed.
License: MIT license
Touchpad 3 Click is a compact add-on board that allows users to easily integrate projected capacitive touch into their applications.
Do you want to subscribe in order to receive notifications regarding "TouchPad 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "TouchPad 3 click" changes.
Do you want to report abuse regarding "TouchPad 3 click".
Library Description
The library covers all the necessary functions to control Touchpad 3 Click board™. Library performs a standard I2C interface communication.
Key functions:
uint16_t *x_axis, uint16_t *y_axis
- Get touch data function.uint8_t offset_loc, uint8_t tx_data, uint8_t *p_response
- Write register data function.uint8_t offset_loc, uint8_t *read_data, uint8_t *p_response
- Read register data function.Examples description
The application is composed of three sections :
void application_task ( )
{
if ( touchpad3_get_int( ) == TOUCHPAD3_INT_STATUS_HIGH )
{
touchpad3_get_touch( &touch_data, &x_axis, &y_axis );
Delay_ms( 100 );
if ( ( touch_data.tch_state == TOUCHPAD3_STATE_TCH ) &&
( touch_data.touch_id == touch_id_state ) )
{
WordToStr( x_axis, log_text );
mikrobus_logWrite( " X Coordinate : ", _LOG_TEXT );
mikrobus_logWrite( log_text, _LOG_LINE );
WordToStr( y_axis, log_text );
mikrobus_logWrite( " Y Coordinate : ", _LOG_TEXT );
mikrobus_logWrite( log_text, _LOG_LINE );
mikrobus_logWrite( "------------------------------", _LOG_LINE );
Delay_ms( 100 );
}
}
}
Additional Functions :
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.