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

nrf51822EK on kit button triggering

I have burnt ble-app-multilink peripheral code on my nrf51822ek. What happens currently is dat when i press button on kit, on kit led turns on . when i press it again, it turns off.

I require that when button is in pressed state it, the led should remain on and when it is released it should turn off.

How is this possible ? any sort of help will be appreciated.

Parents
  • Hi

    It looks like the Board Support Package (bsp) used in the example to handle the button events only supports button presses or button releases. In the example the button event handler is configured to trigger only on button pushes. So to make your peripheral to act like want you will need to write your own gpiote interrupt routine that triggers on both events.

  • You can look into the GPIOTE functionality and drivers. I don't think we have any good examples for GPIOTE right now. There is just this. I can only advice you to read the GPIOTE chapter in the Reference Manual and the driver documentation. What you want to do is to make an interrupt that triggers on both high-to-low and low-to-high events on a pin. Then look at the code in the bsp_event_handler() function in the multilink peripheral and implement it in your GPIOTE interrupt handler.

Reply
  • You can look into the GPIOTE functionality and drivers. I don't think we have any good examples for GPIOTE right now. There is just this. I can only advice you to read the GPIOTE chapter in the Reference Manual and the driver documentation. What you want to do is to make an interrupt that triggers on both high-to-low and low-to-high events on a pin. Then look at the code in the bsp_event_handler() function in the multilink peripheral and implement it in your GPIOTE interrupt handler.

Children
No Data
Related