I would like to implement button interrupt handler. I found two examples in nRF5 SDK v16.0.0. One is examples\peripheral\pin_change_int. And another one is components\libraries\button\app_button.c. Which one will you suggest?
I would like to implement button interrupt handler. I found two examples in nRF5 SDK v16.0.0. One is examples\peripheral\pin_change_int. And another one is components\libraries\button\app_button.c. Which one will you suggest?
Hello,
The app_button library is the easiest way to add buttons to your application, and includes things like the debounce implementation.
The pin_change_int demonstrates how you can use a general pin-change as an interrupt.
If you are adding buttons to your application I would recommend making use of the app_button library :)
Best regards,
Karl
Thanks for your support! Do you have suggested example for using app_button library? Besides, do I need to change BUTTON_ENABLED and BUTTON_HIGH_ACCURACY_ENABLED from 0 to 1?
Thanks for your support! Do you have suggested example for using app_button library? Besides, do I need to change BUTTON_ENABLED and BUTTON_HIGH_ACCURACY_ENABLED from 0 to 1?
snowuyl said:Thanks for your support!
No problem at all, I am happy to help! :)
snowuyl said:Do you have suggested example for using app_button library?
The app_button library is used by all of our ble_peripheral examples, so you could take a look through those to see how you may use it. You can read more about the app button library in its documentation.
snowuyl said:I need to change BUTTON_ENABLED and BUTTON_HIGH_ACCURACY_ENABLED from 0 to 1?
This depends on your application. You will need to have enabled the button, but for a regular button press (like a human pressing the button on a Development Kit) you do not need the HIGH_ACCURACY.
Best regards,
Karl