<?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>dimming continuously using pwm library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38818/dimming-continuously-using-pwm-library</link><description>Hi, 
 From the pwm driver, there is a function that use sequence that control the dimming while not blocking other task in the program, may i ask if there are any function work like this in the pwm library? If none, could you give me the guideline to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Sep 2018 08:09:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38818/dimming-continuously-using-pwm-library" /><item><title>RE: dimming continuously using pwm library</title><link>https://devzone.nordicsemi.com/thread/150617?ContentTypeID=1</link><pubDate>Thu, 27 Sep 2018 08:09:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e52ede3e-4fa6-41c4-b340-30d1131a1edc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I suggest you take a look at demo2() in examples\peripheral\pwm_driver\&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This example has some different demos. demo1() uses the CPU every time it changes intencity (demo1_handler()), demo 2 is only initialized and started with a loop flag.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that demo2() has two different sequences played after one another. First, in seq0 the LEDs will dim from off to on, and then seq1 will blink the LEDs.&lt;/p&gt;
&lt;p&gt;As you see, if you don&amp;#39;t want any CPU interrupts (so that it is not blocking other tasks), you must set all the variables in an array (seq0_values[]).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note that it is possible to slowly dim without blocking, using the solution that &lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt; suggested. But then you need to use the CPU every time you want to update the duty cycle. In the PWM driver example, the PWM peripheral can change duty cycles without interrupting the CPU.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can read about the PWM peripheral &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fpwm.html&amp;amp;anchor=concept_pzc_1pw_nr" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dimming continuously using pwm library</title><link>https://devzone.nordicsemi.com/thread/150605?ContentTypeID=1</link><pubDate>Thu, 27 Sep 2018 07:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8462e7df-2708-483f-9400-6bafffdd7592</guid><dc:creator>sophieyellow</dc:creator><description>&lt;p&gt;Thank you for your help. However I would like it to have a smooth transition to next luminous level, do you know how to achieve that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: dimming continuously using pwm library</title><link>https://devzone.nordicsemi.com/thread/150002?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 11:04:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63f9702b-485d-4c55-a6ac-15513997568c</guid><dc:creator>awneil</dc:creator><description>[quote userid="73894" url="~/f/nordic-q-a/38818/dimming-continuously-using-pwm-library"]could you give me the guideline to achieve the task? [/quote]
&lt;p&gt;Use the PWM driver?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;See:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38607/nrf5-sdk15-0---pwm-driver-just-set-a-fixed-duty-cycle"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/38607/nrf5-sdk15-0---pwm-driver-just-set-a-fixed-duty-cycle&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>