<?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>Is there an example for the dimmable light bulb based on SD, like the mesh example (lightness)?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87616/is-there-an-example-for-the-dimmable-light-bulb-based-on-sd-like-the-mesh-example-lightness</link><description>Hi Support team: 
 Now I am planing to implement the dimmable light bulb based on SD. I looked at the mesh example (light lightness) and actually I abusolutely want to implement my solution like that. But now I just plan to implement it just based SD</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 May 2022 03:11:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87616/is-there-an-example-for-the-dimmable-light-bulb-based-on-sd-like-the-mesh-example-lightness" /><item><title>RE: Is there an example for the dimmable light bulb based on SD, like the mesh example (lightness)?</title><link>https://devzone.nordicsemi.com/thread/366568?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 03:11:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21da3fb0-d57c-4e31-96c1-869dd30487c5</guid><dc:creator>Young</dc:creator><description>&lt;p&gt;I understood. Thank you for your info. I think that I will see if I can refer to the dimmable light bulb example from mesh stack.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there an example for the dimmable light bulb based on SD, like the mesh example (lightness)?</title><link>https://devzone.nordicsemi.com/thread/366520?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 14:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c555692-a33c-4a5e-a254-edc6ffbe4f2c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I do not believe there is a Bluetooth profile for light control, so you will need to implement this in a proprieatry way, e.g. based on the ble_blinky example, but where you instead of turning an LED directly off or on, you can dim the light slowly up or down as you see fit by adding some commands that you interpret the way you want.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there an example for the dimmable light bulb based on SD, like the mesh example (lightness)?</title><link>https://devzone.nordicsemi.com/thread/366505?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 13:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2eb1c86-ff5b-4624-95f3-c22241b714c1</guid><dc:creator>Young</dc:creator><description>&lt;p&gt;Is there an total communication examples for both dimmer and light bulb?&amp;nbsp; and how to tune the lightness at the light bulb?&amp;nbsp; Not just a simple PWM function. I know about the mesh light lightness example, but if there is an example or soluton just based on SD which we can refer to, that will be better for us.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there an example for the dimmable light bulb based on SD, like the mesh example (lightness)?</title><link>https://devzone.nordicsemi.com/thread/366492?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 13:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3efb48ed-c123-48c4-bc1a-937c28fdda5f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not familiar with mesh, but looking at main.c for the lightness client it looks like it is simply calling&amp;nbsp;pwm_utils_level_set() to update the light level, this is a wrapper around the&amp;nbsp;app_pwm_channel_duty_ticks_set() api, which use the following PWM library:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__app__pwm.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__app__pwm.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That said, it might just be easier to use the pwm driver directly, for instance there is a simple pwm example here:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/28081/is-there-a-simple-example-how-to-set-a-pwm-driver/110654#110654"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/28081/is-there-a-simple-example-how-to-set-a-pwm-driver/110654#110654&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the simple example you can find that to dim up or down you can do something as simple as (this should work with the softdevice also):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        for(int i = 0; i &amp;lt;= 100; i++)
        {
            nrf_delay_ms(10);
            pwm_update_duty_cycle(i);
        }
    &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>