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

peripheral_lbs, only button1 work

Hi,

I work with win10 laptop, Toolchain  nrf Connect SDK 1.6.1 on a nrf5340dk.

I try the sample peripheral_lbs, I can use the BTN1 to  turn on a led when I push the button:

"static void button_changed(uint32_t button_state, uint32_t has_changed)
{
    if (has_changed & USER_BUTTON) {
        bt_lbs_send_button_state(button_state);
        app_button_state = button_state ? true : false;
        if (button_state == true)            //mod Rob test allumer led quand appui sur btn1
        {
            dk_set_led(USER_LED, 1);
        }else
        {
            dk_set_led(USER_LED, 0);
        }
    }
}

"

I try to change the USER_BUTTON by button2 or button3 or button4 but It do not work,

only button1 work to turn on/off the led:

"#define USER_BUTTON   DK_BTN1_MSK" => OK

"#define USER_BUTTON   DK_BTN2_MSK" or "#define USER_BUTTON   DK_BTN3_MSK" or "#define USER_BUTTON   DK_BTN4_MSK" => KO

I find the alias of button 1 to button 4 in the file "nrf5340_cpuapp_common.dts",

I don't understand why only the button 1 work.

On the app nRF Connect for mobile (on android) I can see pressed/release for all button, button1to button4.

Could you help me to understand what I did wrong, please ?

Best regards,

Rob

Related