<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>nRF Connect SDK Modifying basic examples</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88844/nrf-connect-sdk-modifying-basic-examples</link><description>Hello All, 
 We are intending to start a new project using nRF52840 SOC, for the same i decided to work with nRF connect SDK as it is recommended by nordic, 
 I am new to Nordic as well as nRF Connect SDK, so i decided to study the nRF Connect SDK fundamentals</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 13 Jun 2022 12:24:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88844/nrf-connect-sdk-modifying-basic-examples" /><item><title>RE: nRF Connect SDK Modifying basic examples</title><link>https://test-devzone.nordicsemi.com/thread/372140?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 12:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fc2f43f-10f0-4716-b4aa-64f552c8420f</guid><dc:creator>user113527</dc:creator><description>&lt;p&gt;Hello Priyanka,&lt;/p&gt;
&lt;p&gt;Thank you for the link i will the same as i want to have a good better understanding about nRF connect SDK with VSCode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also i am not sure what was the problem but my issue is resolved after reinstalling the SDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I request you to please close the ticket and once again thank you for the help and suggestions&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK Modifying basic examples</title><link>https://test-devzone.nordicsemi.com/thread/372087?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 10:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c9a0d4c-b843-4d3e-a025-3968c499acdb</guid><dc:creator>user107729</dc:creator><description>&lt;p&gt;Hi Utkarsh,&lt;/p&gt;
&lt;p&gt;In zephyr when you make changes in buttons, LEDs etc, it would always be better to make the changes in the devicetree, with the help of an overlay file.You can refer to the &lt;a href="https://docs.zephyrproject.org/3.0.0/guides/dts/howtos.html"&gt;zephyr overlay guide&lt;/a&gt; and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.2/zephyr/guides/dts/intro.html"&gt;Devicetree&lt;/a&gt; for the same.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We also have the &lt;a href="https://test-devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-2-ncs-v1-4-0"&gt;Beginners Tutorial for nRF Connect SDK&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK Modifying basic examples</title><link>https://test-devzone.nordicsemi.com/thread/371905?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2022 12:50:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd29ec82-0642-4e87-bec5-156bd833a35c</guid><dc:creator>user113527</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;thank you for quick response&lt;/p&gt;
&lt;p&gt;I really understand this is very basic code but i am not sure why i get this error,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have just added the button polling code to blinky which i have attached below,&lt;/p&gt;
&lt;p&gt;In the below code i have just changed the button 0 to button 2.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define SW2_NODE    DT_ALIAS(sw2)

#if DT_NODE_HAS_STATUS(SW2_NODE, okay)
#define SW2_GPIO_LABEL  DT_GPIO_LABEL(SW2_NODE, gpios)
#define SW2_GPIO_PIN    DT_GPIO_PIN(SW2_NODE, gpios)
#define SW2_GPIO_FLAGS  DT_GPIO_FLAGS(SW2_NODE, gpios)
#else
#error &amp;quot;Unsupported board: sw0 devicetree alias is not defined&amp;quot;
#define SW0_GPIO_LABEL  &amp;quot;&amp;quot;
#define SW0_GPIO_PIN    0
#define SW0_GPIO_FLAGS  0
#endif

void main(void)
{
	const struct device *dev, *button_dev;
	bool led_is_on = true, val; 
	int ret;


	dev = device_get_binding(LED0);
	if (dev == NULL) {
		return;
	}
		button_dev = device_get_binding(LED0);
	if (dev == NULL) {
		return;
	}

	ret = gpio_pin_configure(dev, PIN, GPIO_OUTPUT_ACTIVE | FLAGS);
	if (ret &amp;lt; 0) {
		return;
	}

	ret = gpio_pin_configure(button_dev, SW2_GPIO_PIN, GPIO_INPUT | SW2_GPIO_FLAGS);
    if (ret &amp;lt; 0) {
        return;
    }

	while (1) {
		        
        val = gpio_pin_get(button_dev, SW2_GPIO_PIN); //Read the status of the button
        gpio_pin_set(dev, PIN, val); //Update the LED to the status of the button
        // k_msleep(SLEEP_TIME_MS); // Put the CPU to sleep for 100ms so it does not consume power

		// gpio_pin_set(dev, PIN, (int)led_is_on);
		// led_is_on = !led_is_on;
		// k_msleep(SLEEP_TIME_MS);
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Maybe there is something wrong adding project so now i am planing to restart with new workspace.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Utkarash&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK Modifying basic examples</title><link>https://test-devzone.nordicsemi.com/thread/371853?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2022 11:25:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79d03bf8-cbd3-40d3-bcaa-d9df03bf9d6d</guid><dc:creator>user107729</dc:creator><description>&lt;p&gt;Hi Utkarsh,&lt;/p&gt;
[quote user=""]However For excersize 2 in order to have better understanding i tried importing blinky sample using option &amp;quot;Add new application from sample&amp;quot; and then modified the code for button interrupt,[/quote]
&lt;p&gt;Could you share the changes that you have made?&lt;/p&gt;
&lt;p&gt;Are you using a custom board?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>