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

How to calculate how much time the button is pressed?

I am working on requirement, where if you hold a button for "1 second " it should turn ON LED1 on the DK, likewise when you press button for "5 seconds" it should turn OFF the LED1 and turn ON LED2 .

Now I am facing issue how to calculate the amount of time the button is pressed.

I am using nrf52832, sdk 11.

Could anyone help me in solving this issue?

Thanks in advance.