Hi,
i need to handle a button detection Time, i mean when i push the button for 2 seconds something should happen. How can i use the app_timer_cnt_diff_compute function for that?
Best regards Nils
Hi,
i need to handle a button detection Time, i mean when i push the button for 2 seconds something should happen. How can i use the app_timer_cnt_diff_compute function for that?
Best regards Nils
There isn't currently any automatic way to do this, and the easiest method is currently to register a user directly in app_gpiote. This module gives an event both on a falling and rising edge, and is what app_button relies on internally.
By doing this, you can start a 2 second timer on the falling edge, and stop it on the rising edge. If the button is held for more than 2 seconds, the timeout handler will run, in which you can do whatever action you need.
The app_gpiote module can be used with something like the attached file.
Thank you, it works :)
Thank you, it works :)