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

button function crashing the advertsing

Hello everyone

i want to create button fucntion press the button for 3 seconds and then it has to start advertsing but i have excuted the button fucntion but it si showing some errors in gpiote files so any suggestion or ideas will be helpful for me

main.c

Parents
  • I modified your code and made a very basic example for you. It starts a single-shot timer when you push a button. When the timer event occurs after 3 seconds the application checks whether the button is still pressed and lights a LED accordingly. See comments in code marked with "NORDIC". You can add another timer that can turn off the LED for after 5 seconds.

    Example.

    EDIT: Updated example that starts advertising after 3 second push and stops advertising after 5 second push.

    main.c

    EDIT 2: Exmple with buttons and ble advertising:

    ble-button-timer.c

  • Thank you so much for your help but i am trying to use only one button for both actions like press the button for three secondds then LED 1 turn on and press the same button for 5 sec it will turn off the LED so instead of two button configuration what can i modify to use one button can you suggest me? because am new to this part

Reply Children
No Data
Related