the example I use is nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_hids_mouse\pca10040e\s112\arm5_no_packs
Hello,
Are the button pins connected to anything, or are the pins floating?
Do you have a define called BUTTON_PULL in the same file as your BUTTON_START definition? What is it set to?
The BSP library is handling the logic around button presses, but the buttons are actually set up using app_button_init(), which is called in bsp_init() in bsp.c. It uses the array called app_buttons in the example that you refer to. What does that look like in your case?
Best regards,
Edvin
Best regards
Hello,
So the app_buttons[] have 4 elements for each button.
{pin_no, active_state, pull_cfg, button_handler}
In your case, the active_state is false -> low. So the button is pushed when the pin is changed from high to low. In addition, you have a pullup set in your BUTTON_PULL. This means that if the pad is not trying to set it to either high or low, it will be pulled high.
This works well when a button push shorts the pin to ground when you push a button, and the pin is floating when the button is not pushed (because the pullup will pull it high when the button is not pushed).
Perhaps your touch pads are pulling the pins low, and have an active high? Try to measure with a voltmeter what the state of the output is when the pad is not pushed. What is the voltage difference between GND and touchpad when the pad is pushed and pad is not pushed, and what is the difference between VDD and the touchpad when the pad is pushed and not?
That is:
| - | Pad pushed | Pad not pushed |
| GND->Output | A | B |
| VDD->Output | C | D |
What is A, B, C, and D?
Best regards,
Edvin
|
Pad pushed
|
Pad not pushed
|
|
|
GND->Output
|
0
|
3.328V
|
|
VDD->Output
|
-3.328V
|
0
|