<?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>How to use more that 4 buttons??</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16678/how-to-use-more-that-4-buttons</link><description>Is there any way to use more than 4 buttons using app_button or BSP library?
It seems that GPIOTE can handle only 4 pin. Am I right?? 
 uint32_t err_code;
// Button configuration structure.
static app_button_cfg_t p_button[] = { {BUTTON_1, APP_BUTTON_ACTIVE_LOW</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Sep 2016 11:32:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16678/how-to-use-more-that-4-buttons" /><item><title>RE: How to use more that 4 buttons??</title><link>https://devzone.nordicsemi.com/thread/63821?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 11:32:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df65be2e-8f94-4404-ad56-1726f9ff6395</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS is the number of low-power input pins, so you should only set it to the actually number of low-power input pins you use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use more that 4 buttons??</title><link>https://devzone.nordicsemi.com/thread/63820?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 11:15:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2722b718-839a-4ebc-b39b-88d724819d40</guid><dc:creator>sosse</dc:creator><description>&lt;p&gt;Thank for your answer. Is there any max number of it?? I can also set it as the whole 32 pin as GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS ??
And I wonder that how much the power consumption is increased by increasing the number of it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use more that 4 buttons??</title><link>https://devzone.nordicsemi.com/thread/63819?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 09:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eff2fc39-4201-4459-ab0c-9edf1b5dc0c3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Error code 4 is «NRF_ERROR_NO_MEM”, and is thrown when channel_port_alloc(...) is called and there are no more available GPIOTE channels that could be assigned to the button. In sdk_config.h, you have to increase GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS to 5.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use more that 4 buttons??</title><link>https://devzone.nordicsemi.com/thread/63818?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2016 01:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bcfb866-38ee-4f6b-a1b9-94a896649903</guid><dc:creator>sosse</dc:creator><description>&lt;p&gt;Of course, I defined BUTTON_5 as my custom board pin.
But when I add new button as&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; {BUTTON_5, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_handler}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I got error from &amp;quot;app_button_init&amp;quot;  err_code is 4.
Someone can tell me why??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use more that 4 buttons??</title><link>https://devzone.nordicsemi.com/thread/63817?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 13:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96bc12aa-c019-44e0-9f7e-c6c484b73561</guid><dc:creator>Bill Siever</dc:creator><description>&lt;p&gt;The &amp;quot;BSP&amp;quot; is the board support package for Nordic&amp;#39;s developer boards.  Since boards have limited numbers of buttons only a few buttons are defined, which is why it doesn&amp;#39;t go up to &lt;code&gt;BUTTON_5&lt;/code&gt;.  The &lt;code&gt;BUTTON_X&lt;/code&gt; &lt;code&gt;#define&lt;/code&gt;s just designate which gpio pin will be used for the button.  In the code you&amp;#39;ve included &lt;code&gt;p_button&lt;/code&gt; is an array and you can put as many things in it as you&amp;#39;d like (up to the max of using all the available IO pins). To add another button just add a new item, like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{YOUR_BUTTONS_GPIO, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_handler}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Where &amp;quot;YOUR_BUTTONS_GPIO&amp;quot; is replaced with a GPIO pin number (or defined constant for the pin number).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>