<?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>Long button press to trigger an event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55243/long-button-press-to-trigger-an-event</link><description>Hello Nordic team, 
 I am trying to develop a long button press handler, but I am unable to find the proper documentation or example code to help with that. I am not sure if I should use bsp.c or app_button.c. 
 Reading through devzone has me more inclined</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jan 2020 14:37:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55243/long-button-press-to-trigger-an-event" /><item><title>RE: Long button press to trigger an event</title><link>https://devzone.nordicsemi.com/thread/228183?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2020 14:37:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4ad8b91-ea8b-4b69-b9ed-dad811a0c7f9</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/NordicPlayground/nrf51-app-button-example/blob/master/main.c"&gt;https://github.com/NordicPlayground/nrf51-app-button-example/blob/master/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This was also helpful&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Long button press to trigger an event</title><link>https://devzone.nordicsemi.com/thread/228065?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2020 09:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:118177b1-a4a8-41ef-9732-5e0bba56a4e4</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi again!&lt;/p&gt;
&lt;p&gt;It is my understanding that you want to differentiate between a long button press (a hold) and a short button press (a press), is that correct? If yes, the answer from Vidar in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43506/how-to-use-bsp_button_action_push-and-bsp_button_action_long_push-on-the-same-button-with-two-different-functions"&gt;this thread&lt;/a&gt; provides an example for how to do this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know if that wasn&amp;#39;t what you were looking for.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Long button press to trigger an event</title><link>https://devzone.nordicsemi.com/thread/228005?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2020 00:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51c14d21-b0a8-4b31-8111-7743f60c018c</guid><dc:creator>Tandon</dc:creator><description>&lt;p&gt;Heidi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Your response has helped me a lot. I decided to go with button handler approach. However, I do have a query with that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Upon a button press - I seem to be getting 2 events. My guess is from HighToLow and LowToHigh. There is, unfortunately, no RC filter in place that can help with this. Tweaking the&amp;nbsp;BUTTON_DETECTION_DELAY has also not been of much help. Are there any other approaches that might help?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible for me to initialize&amp;nbsp;&amp;nbsp;GPIOTE_CONFIG_IN_SENSE_HITOLO&amp;nbsp;and GPIOTE_CONFIG_IN_SENSE_LOTOHI, instead of a single&amp;nbsp;GPIOTE_CONFIG_IN_SENSE_TOGGLE? Any direction or example would help me greatly.&lt;/p&gt;
&lt;p&gt;In my application, I need to detect a hold and press. A hold is detected with an app timer, I believe.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Happy New Year and thanks in advance!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Long button press to trigger an event</title><link>https://devzone.nordicsemi.com/thread/225236?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2019 17:32:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1635551-d804-4f37-933e-38d6004ab353</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi! I apologize for the slow response.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to assume you&amp;#39;re asking about the difference between the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_bsp.html"&gt;Board Support Package&lt;/a&gt; (BSP)&amp;nbsp;and the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__app__button.html"&gt;Button Handler&lt;/a&gt;. Please correct me if my assumption is wrong.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The BSP provides another layer of abstraction on top of the button handler, but it is mostly used for handling buttons in BLE examples, using the BSP BLE Button Module. If you are just writing a simple button handler, I would use the Button Handler library.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you take a look at bsp.c, app_button.h is included in that. So it utilizes the functions in the button handler, but it provides another layer of abstraction.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>