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

button exmaple is not working in SDK version 9.0.0

Hello evryone,

i cloned button example form github to sdk version 9.0.0 and i modified the neccesary changes between app.gpiote.c//nrf_drv_gpiote.c files and set the GPIOTE ENABLED to 0 after that it is getting compiled with no errors but the baord shows nothing if the press any of the button can anyone suggest me what modifications has to be done or any changes?

ble_app_template.zip

Thank you

prabhu

Parents
  • TIMER2 is 16 bit so prescaler 4 wont fit in it. you have to change it to prescaler 10. If you press the button for 3 seconds, LED will glow, what happens if you did not release it and continue for 5 seconds? should the LED that started glowing after 3 seconds turn off? anyway, i have modified your file and given you a template. This will let the LED glow if you press the button for 3 seconds and will turn of if you press it for 5 seconds.

    main.c

Reply
  • TIMER2 is 16 bit so prescaler 4 wont fit in it. you have to change it to prescaler 10. If you press the button for 3 seconds, LED will glow, what happens if you did not release it and continue for 5 seconds? should the LED that started glowing after 3 seconds turn off? anyway, i have modified your file and given you a template. This will let the LED glow if you press the button for 3 seconds and will turn of if you press it for 5 seconds.

    main.c

Children
  • hello aryan thanks for your help i am trying to implement the buzzer application in my program but am struggling to resolve this issue , while the button part is wroking then the Buzzer is not working if buzzer is working then button is not working can you please verify my code what is the mistake in my logic or am trying to implement the fucntion like this after pressing the button then only the buzzer has to beep

  • I did not see anything wrong with your main file. But I did not see anything related to buzzers as well. It will be helpful to if you can send me your full project. Also you are allowing your TIMER2 to overflow, what interval do you want on your TIMER2? is it CC[0] or CC[1]. You have to enable the short to clear the timer with one event.

    Take a look in the register description for Timer COMPARE0_CLEAR - Shortcut between EVENTS_COMPARE[0] event and TASKS_CLEAR task COMPARE1_CLEAR - Shortcut between EVENTS_COMPARE[1] event and TASKS_CLEAR task

  • Hello Aryan,

    I have uploaded my program in the main post please have a look and i am trying to create the function like this press the button for three seconds then only the buzzer has to beep for three seconds and also i ahve configured the gpio pin6, pin 7 in high drive mode inorder to increase the loudness of the buzzer please suggest me how to interface the buzzer and button it would be useful for me Thank you

Related