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: 2019-09-04
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Pushbutton/Switches
Downloaded: 2586 times
Not followed.
License: MIT license
Button Power Click is a very interesting interactive gadget on a Click board. It is an integrated capacitive touch sensor display in the form of a button.
Do you want to subscribe in order to receive notifications regarding "Button POWER click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Button POWER click" changes.
Do you want to report abuse regarding "Button POWER click".
Library Description
The library contains button check functions and LED control.
Key functions:
void buttonpower_set_led_state ( uint8_t led_state )
- Led controluint8_t buttonpower_get_button_state ( void )
- Get button stateExamples description
The application is composed of three sections :
void applicationTask()
{
uint8_t cnt;
uint8_t button_state;
button_state = buttonpower_get_button_state( );
if ( button_state == BUTTONPOWER_BUTTON_IS_PRESSED )
{
mikrobus_logWrite( " >> Button is pressed ", _LOG_LINE );
for ( cnt = 0; cnt < 5; cnt++ )
{
buttonpower_set_led_state( BUTTONPOWER_LED_OFF );
Delay_ms( 100 );
buttonpower_set_led_state( BUTTONPOWER_LED_ON );
Delay_ms( 100 );
}
}
}
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.