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

GPIO interrupt example

I'm using the nRF51822 Beacon with S110 and the example ble_app_beacon as basic programm. I'm a newbie with the beacon, so maybe I have problem with the basics in programming it.

I configures pin 0 as input. Now I want to read this input and with every toggle I want to start a timer. When the timer expired I want to count a variable + 1.

I tried it with a simple nrf_gpio_pin_read(); in the main function, but it doesn't work. I see that with sd_app_evt_wait(); the beacon will go into a sleep mode and is waiting for a new event. So I have to put the timer reset into an interrupthandler, that is called when the input toggles. But I don't understand what i have to do. I found many questions (and answers) to that subject, but there so many flags, defines and funcion-calls that I do not understand.

Can someone give me a simple example how to configure the pin and its interrupthandler?

Parents Reply
  • Hi, 

    I am working on the same and I need to developing code using "pin_change_int" as reference to develop the interrupt based event and calling the function assign to it.

    Can please me sample code to get the better clarification.

    And one more thing that I am concern about that does it support sleep mode or not, because I am looking for the sleep after works get completed.

    Looking for the kind support and help ...

    Thanks

Children
No Data
Related