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

  • sorry, I have no buzzer, i have connected them to LED_! and LED_2 and they are glowing bright. Buzzers are different with different current consumption and loudness. So I cannot comment on how they should perform. With LEDs i can confirm that the code logic is now OK for buzzer.

    I have also verified that if i press BUTTON1 for 3 seconds then LED3 glows and if i press button2 for 3 seconds then LED3 turns off. So your timers are also working fine.

  • yes thank you can you send me the code that you have tested because button part is working separtely and pwm part is working sepately when i press the button 3 sec only LED 1 is blinking and when i press the button for 5sec led 1 is turned off but it is not interfacing with the pwm am trying to make the buzzer beep after the button is pressed for three seconds did my program is correct for performing this function please let me know about this point

    Thank you

  • Hi prabhurai, Sorry, i have edited your code to test.

    you are not testing pin number 7
    app_pwm_channel_duty_set(&PWM1, 0, 10);  // This is for channel 0 means pin number 6
    app_pwm_channel_duty_set(&PWM1, 1, 10);  // This is for channel 0 means pin number 7
    

    Also there is no PWM code in timer_handler(). which means when you press buttons for few seconds only LED is toggled. You need add app_pwm_channel_duty_set for correct pwm channel (ch 0 for pin 6 and ch 1 for pin7) for the channel you want to do

  • yes i understand your modifications i have set the duty cycle of channel 0 in pin6 to 50 and channel 2 in pin 7 to 50 can you give me some ideas how to add some pwm code to timer handler do i call teh app_pwm enable function in the timer handler?

  • i have tested the the buzzer by configuring channel 0 pin 6 and channel 1 pin7 but the pin 6 continously receiving 2.9v at the same time the pin 7 is shpwing only 1.5v whenever the buzzer is making beep rest of the time pin 7 showing only 0v can you please clarify this issue?

    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(160UL,7,6);//6.3KHz

    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_LOW;

Related