<?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>Add button to peripheral UART Example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103789/add-button-to-peripheral-uart-example</link><description>I am building an running the peripheral UART example on a PCA10040. I would like to add a button to the code but I am not having any luck getting the code to compile. I have run through the SDK Fundamentals course in the DevAcademy, and I have also been</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Sep 2023 15:48:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103789/add-button-to-peripheral-uart-example" /><item><title>RE: Add button to peripheral UART Example</title><link>https://devzone.nordicsemi.com/thread/446111?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2023 15:48:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ef39b54-7be4-4f90-b8e3-ac35435b968e</guid><dc:creator>Johnny Nguyen</dc:creator><description>&lt;p&gt;Hey Tom,&lt;/p&gt;
&lt;p&gt;I had a sample repo where I added a custom GPIO instead of a button, but the intention was a button.&lt;/p&gt;
&lt;p&gt;You can look at this PR diff and simply replace the custom gpio with one of the devkit buttons.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/droidecahedron/nrf_peripheral_uart_custom_gpio/commit/5cdeef3deb008973e5bc3fe787a030f35b1bfd35"&gt;Merge pull request #1 from droidecahedron/custom_gpio &amp;middot; droidecahedron/nrf_peripheral_uart_custom_gpio@5cdeef3 (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;(for instance, instead of using&amp;nbsp;gpiocus0 in l92, you can use sw0 for switch 0.)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and here is a diff for your uploaded project to build successfully for sw0.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1694708995317v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The exercises here can help you quite a bit:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-2-reading-buttons-and-controlling-leds/"&gt;Lesson 2 &amp;ndash; Reading buttons and controlling LEDs &amp;ndash; Nordic Developer Academy (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>