<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>There seems to be a problem in controlling led sequentially using a timer.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66419/there-seems-to-be-a-problem-in-controlling-led-sequentially-using-a-timer</link><description>Hello. I&amp;#39;m working on sdk v17 and I&amp;#39;m trying to control the LEDs in order using a timer. Before using the timer, we made it easy using delays. Apps work when they receive certain data 
 
 
 And I made a timer and used it without delay. 
 
 
 
 
 However</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Sep 2020 09:20:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66419/there-seems-to-be-a-problem-in-controlling-led-sequentially-using-a-timer" /><item><title>RE: There seems to be a problem in controlling led sequentially using a timer.</title><link>https://devzone.nordicsemi.com/thread/271719?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 09:20:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:819773f6-d4d4-4173-9976-7293b00872ab</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looking at the first implementations with only delays, that seems straight-forward. Looking at the second implementation I see that you have replaced the delays with calls to&amp;nbsp;LeftLED_timers_start(), where you essentially just start the app timer instance. You do not wait for anything, so it should just continue immediately after. Obviously that is not want you want, but you should not get other issues (like &amp;quot;stop everything&amp;quot;), as calling app_timer start for an allready running timer is&amp;nbsp;allowed. Have you debugged to see what is happening? Are any errors returned from any function calls or similar? If you are still stuck, please share a bit more of your code so that we can better understand what is going on.&lt;/p&gt;
&lt;p&gt;I also want to mention that while I do not see any waiting in your second code (waiting for the timer to timeout), you should remember interrupt priorities. The NUS handler will normally have the same interrupt priority as the lowest SoftDevice priority, and therefore you need to have a higher priority for the app timer for this to work if you intend to use delays in there. A better solution is to move this LED code out of the interrupt, and handle it in main/thread context, as long lasting interrupts is never a good idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>