TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137103 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56126 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42079 times)
  6. FT800 Library (41389 times)
  7. GSM click (29116 times)
  8. mikroSDK (26563 times)
  9. PID Library (26503 times)
  10. microSD click (25487 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: 2710 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

LED Driver 12 click

0

LED Driver 12 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the PCA9532, a 16-bit I2C-configurable I/O expander optimized for dimming LEDs in 256 discrete Red/Green/Blue (RGB) steps from NXP Semiconductors. The PCA9532 offers high efficiency, supporting up to 16 LED channels and delivering a maximum of up to 25mA of LED current per channel. It contains an internal oscillator with two user-programmable blink rates and duty cycles coupled to the output PWM. Any bits not used for controlling the LEDs can be used for GPIO expansion, which provides a simple solution when additional I/O is needed for some sensors, push-buttons, or alarm monitoring. This Click board™ is suitable for color mixing and backlight application for amusement products, LED status signalization, home automation projects, and many more.

[Learn More]

ROTARY Y click

0

Rotary click carries a 15-pulse incremental rotary encoder with detents, surrounded by a ring of 16 yellow LEDs. It’s a perfect solution for adding a precision input knob to your design. The encoder outputs A and B signals (out of phase to each other); the knob also acts as a push-button which sends an interrupt to the target board MCU. The LED ring is controlled through SPI lines (CS, SCK, MISO, MOSI). Rotary click can be used with either a 3.3V or 5V power supply.

[Learn More]

C Meter click

1

C Meter click is a mikroBUS add-on board with circuitry for measuring the value of capacitors. The design is based on a NE-555 timer/square-wave generator.

[Learn More]