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

Button Release in esb_low_power_ptx

Hi,


LED is on when the button is pressed. Press the button again and the LED off. I want the Turn the LED on as long as I press the button. Turn off the LED when I stop pushing the button.. How can I send evente again after the button is released. 

 I am working in nRF5_SDK_15.2.0_9412b96 sdk. 

I am working the project esb_low_power_ptx  - esb_low_power_prx  


How can I add the bsp library to this project I'm working on.

Parents
  • Hi Sema, 

    You need to modify the code. 

    What happening now in the ptx code is that when you press the button, the chip wake up, check the button state , send the message and wait until the buttons are released before enter sleep mode again. 

    What you need to do is to either, before enter sleep mode again, send another ESB message saying the button is released. Or if you want to safe power even more, switch the sense state of the buttons and enter sleep mode again when the button is still pressed. And because of that when the button is released, the chip will be woken up again and send another ESB message telling that the chip is released. 

Reply
  • Hi Sema, 

    You need to modify the code. 

    What happening now in the ptx code is that when you press the button, the chip wake up, check the button state , send the message and wait until the buttons are released before enter sleep mode again. 

    What you need to do is to either, before enter sleep mode again, send another ESB message saying the button is released. Or if you want to safe power even more, switch the sense state of the buttons and enter sleep mode again when the button is still pressed. And because of that when the button is released, the chip will be woken up again and send another ESB message telling that the chip is released. 

Children
No Data
Related