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

How to merge RTC peripheral code with ble_app_uart to generate delay of 10 seconds

Hey guys , 

I am trying to merge ble_app_uart code with RTC peripheral code . RTC code works fine when I try it on SDK but after merging with ble_app_uart code it doesn't work. I have done all the configuration settings. 

Here is my actual objective 

1. I have added a button on gpio pin 28

2. I have attached an led on gpio pin 16 with pull up

3. What I need to do is that when I press the button led should be able to glow for 10 seconds ?

Thanks in advance.

Parents
  • Hello,

    Maybe something you have considered already, but I think you will find it easier to work with the Timer library than to work directly with the RTC driver, especially if you will be needing to set up multiple timer events in the future. You can see how app timer instances are configured and started from other sdk examples such as ble_app_hrs and ble_app_blinky.

    What I need to do is that when I press the button led should be able to glow for 10 seconds ?

     You can turn on the led from the button callback, then at the same time, start a "single shot" app timer instance with a 10 second timeout to turn off the led again.

    Best regards,

    Vidar

Reply
  • Hello,

    Maybe something you have considered already, but I think you will find it easier to work with the Timer library than to work directly with the RTC driver, especially if you will be needing to set up multiple timer events in the future. You can see how app timer instances are configured and started from other sdk examples such as ble_app_hrs and ble_app_blinky.

    What I need to do is that when I press the button led should be able to glow for 10 seconds ?

     You can turn on the led from the button callback, then at the same time, start a "single shot" app timer instance with a 10 second timeout to turn off the led again.

    Best regards,

    Vidar

Children
No Data
Related