TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137003 times)
  2. FAT32 Library (70123 times)
  3. Network Ethernet Library (56028 times)
  4. USB Device Library (46348 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41286 times)
  7. GSM click (29055 times)
  8. mikroSDK (26489 times)
  9. PID Library (26451 times)
  10. microSD click (25413 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Power/Reset click

Rating:

5

Author: MIKROE

Last Updated: 2019-10-04

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Capacitive

Downloaded: 2697 times

Not followed.

License: MIT license  

Power/Reset Click is equipped with two capacitive touch pads on a single click boardâ„¢. It can be activated by touch, and unlike the mechanical button, the capacitive touch button lasts much longer, it is not prone to damage and wear over time and it is very reliable.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Power/Reset click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Power/Reset click" changes.

Do you want to report abuse regarding "Power/Reset click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Power/Reset click

Power/Reset click

Native view of the Power/Reset click board.

View full image
Power/Reset click

Power/Reset click

Front and back view of the Power/Reset click board.

View full image

Library Description

This library allows user to check which button is pressed or activated. Also initializes GPIO driver. For more details check documentation.

Key functions:

  • void touchbutt_gpioDriverInit(T_TOUCHBUTT_P gpioObj) - This function initializes GPIO driver.
  • T_TOUCHBUTT_STATE touchbutt_getPWR( void ) - This function returns a state of the PWR pin (ON/OFF button).
  • T_TOUCHBUTT_STATE touchbutt_getRST( void ) - This function returns a state of the RST pin (RESET button).

Examples description

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes GPIO driver and performs a timer interrupt configuration.
  • Application Task - (code snippet) - Checks the states of the PWR and RST pins and performs a control of the timer counter depending on the pressed button (pins state). User can start and stop a timer counter, in the resolution of 100ms, by pressing the ON/OFF button. Also can reset a timer counter to 0 by pressing the RESET button. When timer counter was reached the target time (in seconds), a message will be sent to the uart terminal and the sound will be generated. Timer counter state will be showed to the uart terminal.
void applicationTask()
{
    pwr_state = touchbutt_getPWR();
    rst_state = touchbutt_getRST();
    
    if ((pwr_state == _TOUCHBUTT_ACTIVE) && (time_cnt_prev != time_cnt) && (rst_state == _TOUCHBUTT_INACTIVE))
    {
        time_val_dec = time_cnt / 10;
        time_val_real = time_cnt % 10;
        
        LongWordToStr( time_val_dec, text );
        Ltrim( text );
        mikrobus_logWrite( text, _LOG_TEXT );
        mikrobus_logWrite( ".", _LOG_TEXT );
        ByteToStr( time_val_real, text );
        Ltrim( text );
        mikrobus_logWrite( text, _LOG_LINE );
        
        if ((time_val_dec >= target_time) && (alarm_flag == _TOUCHBUTT_ACTIVE))
        {
            mikrobus_logWrite( "** Target time is reached! **", _LOG_LINE );
            alarm_flag = _TOUCHBUTT_INACTIVE;
            
            Sound_Play( 1000, 50 );
            Delay_ms( 40 );
            Sound_Play( 1000, 50 );
            Delay_ms( 40 );
        }
    }
    
    if (rst_state == _TOUCHBUTT_ACTIVE)
    {
        time_cnt = 0;
        alarm_flag = _TOUCHBUTT_ACTIVE;
    }
    else
    {
        time_cnt_prev = time_cnt;
    }
}


The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • Conversions
  • C_String
  • Sound
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

TILT-n-SHAKE click

5

TILT-n-SHAKE click carries Freescale’s MMA8491Q IC. It’s a multifunctional 3-axis digital accelerometer that can also be configured as a 45-degree Tilt sensor. As an accelerometer, it communicates with the target MCU through mikroBUS™ I2C pins (SCL, SDA).

[Learn More]

MRAM 3 click

0

MRAM 3 Click is a compact add-on board representing a magneto-resistive random-access memory solution. This board features the AS3001204, 1Mb high-performance serial SPI MRAM memory organized as 128K words of 8 bits each from Avalanche Technology. The MRAM technology is analog to Flash technology with SRAM compatible read/write timings (Persistent SRAM, P-SRAM), where data is always non-volatile. It also has a hardware write-protection feature and performs read and write operations with data retention for one million years and a write endurance of 1014 cycles.

[Learn More]

Solar Energy click

4

There are many battery chargers and solar energy harvesters out there already, but the Solar energy click has the unique feature - it encompasses both of these devices in a single package.

[Learn More]