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

key delay and nrf_delay_ms() function

HI

   The SDK is "nRF5_SDK_for_Thread_and_Zigbee_v4.1.0" and I find a question that is: for all thread programs, add  nrf_ delay_ ms () function in while (true) will affect the operation delay of the key, what's the matter? 

  thanks!

Parents
  • Hi

    Okay, adding the nrf_delay_ms(1000); there will cause all actions within this while loop to be delayed by 1 second, so when you've added this delay, you will need to hold the button down for a little over a second, as it delays all operation by 1 second, and will not register the button as pressed unless it is pressed inbetween the delays.

    Depending on where you want this delay to have effect, you will need to move where the delay is triggered.

    Best regards,

    Simon

Reply
  • Hi

    Okay, adding the nrf_delay_ms(1000); there will cause all actions within this while loop to be delayed by 1 second, so when you've added this delay, you will need to hold the button down for a little over a second, as it delays all operation by 1 second, and will not register the button as pressed unless it is pressed inbetween the delays.

    Depending on where you want this delay to have effect, you will need to move where the delay is triggered.

    Best regards,

    Simon

Children
Related