nRF51 SDK - S210 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Button Debouncer Example

The Button Debouncer Example shows GPIO usage with integrator debouncer to read the GPIO pin states. By pressing and holding one or more buttons on the the nRF51822 Development Kit, the corresponding LEDs will turn on. By releasing a button, the corresponding LED will turn off.

The source code and project file can be found in the <InstallFolder>\Nordic\nrf51822\Board\nrf6310\debounce_example folder.

When the application starts, the timer for handling debouncing is configured and started, including enabling the timer interrupt. The GPIO-pins 0-7 are configured for input (Buttons), and the GPIO-pins 8-15 are configured for output (LEDs).

Setup

Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).

LED assignments:

  • LED 0-7: Turns on if corresponding button is pressed.

Buttons assignments:

  • Button 0-7: Button press is debounced and turns the corresponding LED on while pressed.

Testing

The Button Debouncer Example Application can be tested as follows:

  1. Compile and program the application.
  2. Press buttons and check if the corresponding LEDs are lit.