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

[nrf_gpio/app_gpiote/nrf_drv_gpiote]

Hello Nordic,

I am following example code [--ble-app-lbs-master] for my application in (keil4.6/sdk8.0.0). Its already consisting (app_gpiote), but I want to add some code module which refer (nrf_drv_gpiote). Is it compulsory to use both files or only file can be used instead of two? How can I do so?

I tried to follow some previous posts but didn't get it well. Also, I am unable to see the icon for "run-time-environment" and "software-pack" icons (showing disabled) in Keil4.6.

Please suggest~

/Thanks n Regards

  • HI HSA

    You have now the button example and the timer example for SDK 8.0.0. Now you have to combine those examples in order to make it work. When you press the button you can start the timer and let it periodically read the pin state. Log that out on RTT, UART, or write that to array.

  • Hi @Stefan,

    Thanks and yes, I am trying to do so.

    well, I want to add and create a new timer for [button_debounce] and [ detection_delay_timeout_handler]; but I found, its already mentioned in (app_button.x). How can I directly call this. Can I use this already defined timer (in app_button.c) for counting button_debounce ?

    Please suggest.

    Thanks n Regards

  • Hello @Stefan Birnir Sverrisson,

    Thanks for your support so far. Please make me understand one more time. As I am following [--ble_app_lbs_master-- example] for my application, I need to add the --button_debounce-- in this. I created the timer as you suggested before. LED_2 blinking as per the sampling, but button_press is not working. Also the [--ble_app_lbs_master--] is not including nRF_Drivers/nRF_Softdevice/nRF_BLE/nRF_Libraries....It inlcudes Source code/Services/Libraries...is there any big difference in doing so ?

    Your suggested "button example" includes nrf_drv_gpiote.x", which you suggested not to use. So I am just following "app_gpiote.c" with [--ble_app_lbs-master--] example. Could you please suggest, what to so in this case. Please clear my confusion.

    Thanks n Regards

  • Hi HSA

    Looking at your case again makes me somewhat confused. I understand that you want to use the nrf51_ble_app_lbs example and use app_button library (which includes debounce function) with it to detect button presses, am I correct? But the nRF51-ble_app_lbs example already uses app_button library (see the buttons_init function) with debounce function, so there is nothing really to add to the example.

    If I am misunderstanding your intention, please clarify.

  • Hello @Stefan Birnir Sverrisson sir

    Thanks for your reply and understanding.

    Yes, It includes button_init function. I mean to say that I want to read the debouncing values at button_pin after every duration of some (milliseconds) using timer/interrupts. [when I press button, timer/interrupt starts to read the button_pin_value and store in some array (like this: In starting the pin_state is not stable so it may read like 1,0,1,0,1...and after some delay it read the stable value like 1,1,1,1,...ans when I release the button, it should read 1,0,1,0...something like and later it should stable like 0,0,0,0..... and store these all states in an array or buffer]. Also where I should read the value?

    Please share some solution.

    Thanks n Regards

Related