This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Toggle LED using buttons on light_lightness server example

I am using nrf52840 mesh v17.0.2 light_lightness server example.

In the original Light lightness server code, you can control LED1 using J-Link RTT Viewer. By sending the value 1 or 2 you can decrease or increase the brightness respectively.

What I want to achieve is instead of using J-link to send commands to toggle the brightness, I want to be able to use one physical button (button 3) to toggle LED1.

For instance, by pressing button 3 the first time, LED1 will go to maximum brightness. When the button is pressed a second time, LED1 will be turned off.

How do I go about achieving this? Any help would be greatly appreciated!

Related