nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Pin Change Interrupt Example

The Pin Change Interrupt Example demonstrates interrupts on pin change on pin 0. Pin 8 is configured as output and toggled in the pin change interrupt handler. It uses the hardware delivered in the nRF51822 Development Kit.

The application starts with configuring the pins and configuring GPIOTE to give an interrupt on pin 0 change. The interrupt handler toggles pin 8 (LED 0) when pin 0 (button 0) is pressed.

Setup

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

LED assignments:

  • LED 0 is toggled by interrupt.

Button assignments:

  • Button 0 triggers interrupt that toggles LED 0.

Testing

The Pin Change Interrupt Example Application can be tested as follows:

  1. Compile and program the application.
  2. Press Button 0 and check if LED 0 toggles.