This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to generate 2 evensts on single gpio interrupts

Hi in my case,

i pressed gpio button for one time it will do one event.

and for double press it will do another event . how can i do this one,

Regards Balaji

Parents
  • I'm not quite sure I understand what you mean, but if what you need is to differentiate between different types of press on a single button (for example do something if the button is pressed shortly, but something else if the button is pressed for > 2 s or on double presses), this is something you have to do in your application. Exactly how will be dependent on the exact behavior you need, but some sort of timing and counting will most likely be needed, which can be done using app_timer.

Reply
  • I'm not quite sure I understand what you mean, but if what you need is to differentiate between different types of press on a single button (for example do something if the button is pressed shortly, but something else if the button is pressed for > 2 s or on double presses), this is something you have to do in your application. Exactly how will be dependent on the exact behavior you need, but some sort of timing and counting will most likely be needed, which can be done using app_timer.

Children
No Data
Related