<?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 detection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68109/long-button-press-detection</link><description>Hello everyone, 
 I&amp;#39;m programming nRF52833 for my own application. In my application, I have a button to turn on and turn off the supplier. There is only 1 button so that I decided to have a plan like this: 
 
 If I press the button and hold it for 1</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 09 Nov 2020 17:31:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68109/long-button-press-detection" /><item><title>RE: Long button press detection</title><link>https://devzone.nordicsemi.com/thread/279089?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 17:31:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86e16b57-a85b-42c5-b1a2-73dfac8bb999</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;BSP only implements support for one Long press button action (in addition to push and release actions). If you want multiple long-push actions, you must implement this yourself in your application. You can use app_button together with app_timer to control the button actions. Start the two timers when the button is pushed, and set flags in the timer timeout handlers indicating if the timers has expired, and check the flags in the button handler when the button released event is generated, to determine the length of the button press.&lt;/p&gt;
&lt;p&gt;This should work fine together with FreeRTOS, just make sure you use the freertos implementation of app_timer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>