TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136545 times)
  2. FAT32 Library (69739 times)
  3. Network Ethernet Library (55845 times)
  4. USB Device Library (46180 times)
  5. Network WiFi Library (41803 times)
  6. FT800 Library (40990 times)
  7. GSM click (28924 times)
  8. PID Library (26385 times)
  9. mikroSDK (26286 times)
  10. microSD click (25300 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: 2640 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

Single Wire CAN click

0

Single Wire CAN Click is a compact add-on board that contains an IC for a single wire data link capable of operating with various protocols such as the Controller Area Network (CAN). This board features the NCV7356D1R2G, Single Wire CAN transceiver from ON Semiconductor, which operates from a supply voltage from 5V to 27V with bus speed up to 40 kbps.

[Learn More]

Temp-Hum 3 click

5

Temp-Hum 3 click is a smart environmental temperature and humidity sensor Click board, packed with features, that allows easy and simple integration into any design that requires accurate and reliable humidity and temperature measurements.

[Learn More]

Barometer 9 click

0

Barometer 9 Click is a compact add-on board ideal for precision activity tracking and indoor navigation/localization. This board features the ENS220, a barometric pressure and temperature sensor from ScioSense

[Learn More]