This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Perfoming an action after pressing two buttons ?

I want to develop an app that wakes app from sleep mode after pressing 2 buttons, then if these buttons are still pressed for 5 secondes i want to do an action ..

Any idea how to implement this ?

Thanks

  • GPIOTE event on each button. When a button is toggled, set a flag for this button (true if button was toggled first time, i.e pressed, false next time you get the event).

    In gpiote callback/ISR, start a timer when both flags are set. Connect toggle event to timer STOP task through PPI after starting the timer. This way, if a button toggle happens when the timer is running, it will be stopped and the timer that is set to interrupt you after 5 seconds will not fire.

Related