<?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 make Nrf51822 wake up by button, increment variable then sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8647/how-to-make-nrf51822-wake-up-by-button-increment-variable-then-sleep</link><description>I&amp;#39;ve just started working with Nrf51822, I&amp;#39;m trying to make this scenario for weeks but i failed. 
 Plz help me! 
 How to make Nrf51822 wake up by a button click, increment a variable then go back to sleep?
i&amp;#39;ve tested __WFI() and __WFE() but it doesnt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Aug 2015 09:41:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8647/how-to-make-nrf51822-wake-up-by-button-increment-variable-then-sleep" /><item><title>RE: How to make Nrf51822 wake up by button, increment variable then sleep</title><link>https://devzone.nordicsemi.com/thread/31682?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2015 09:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2192043-36b2-4a4c-b845-dbc353b91ad0</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/NordicSemiconductor/nrf51-powerdown-examples"&gt;system-on-wakeup-on-gpio&lt;/a&gt; is the most simple example for going to sleep, and wake up again on a button press. It is without using a softdevice. References to other useful examples can be fount in the &lt;a href="https://devzone.nordicsemi.com/question/5186/how-to-minimize-current-consumption-for-ble-application-on-nrf51822/#reply-5187"&gt;current consumption guide&lt;/a&gt;, section &amp;quot;Measure current consumption&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make Nrf51822 wake up by button, increment variable then sleep</title><link>https://devzone.nordicsemi.com/thread/31681?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2015 09:26:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d4650ee-a617-4ca1-8702-abe7790dc8a1</guid><dc:creator>michaeld</dc:creator><description>&lt;p&gt;In my tests with the sleeping and system-off modes is that the devices automatically sleeps when it does nothing. This what the function power_manage() is for. I have seen hardly any difference in current consumption when sleeping or when in power_manage.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s more power efficient to go to system-off but then you&amp;#39;ll need to save all  your values in flash or use pstorage.&lt;/p&gt;
&lt;p&gt;If sleeping is enough for you then I would just add the button handler and increment when button is pushed.&lt;/p&gt;
&lt;p&gt;You can use this:
&lt;a href="https://devzone.nordicsemi.com/question/28605/how-do-i-use-button-push-interrupt/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or use App_button library there are many examples and questions about this topic that can help you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>