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

How to create double push button interrupt on NRF51DK

Hello Everyone,

I wrote the simple software for long push 3 sec and long long push for 5 sec and it is working fine as expected but can anyone suggest me how to create simple logic for double push button interrupt because am trying to create those logic but unable to succeed when i push the button interrupts are getting executed but i want to execute the interrupt only if i push double times the button please suggest me some simple logic am just between beginner and intermediate stage in programming skills so am trying simple things by using NRF51DK any help are suggestions would be greatly appreciated

Thank you

Parents
  • what you mean by double push? do you mean push two buttons, or push the button two times in a row?

    If it's the first case, you can put a flag on your button press handler and do what you want if both flags are on.

    For the second case you can put a flag on your button handler and start a timer, then on the timer handler another flag signaling the end of the time for the double push, and if you press the button inside the time you configured on the timer (so, without setting the flag of the timer) you go to the function you want to execute.

    You also should say which softevice and SDK you are using;)

    Hope this helps,

    Jorge Costa

  • am using similar to second case push two times in a row continuously

Reply Children
No Data
Related