<?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>increment counter on button pressed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82232/increment-counter-on-button-pressed</link><description>Hello everyone, i need to increment a counter each time my button on the nrf534DK is pressed i&amp;#39;m using sdk v 1.7.1 . is there a simple way to do it or a function which supports this do you have any example that can guide me through, so that i can implement</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Nov 2021 10:42:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82232/increment-counter-on-button-pressed" /><item><title>RE: increment counter on button pressed</title><link>https://devzone.nordicsemi.com/thread/341245?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 10:42:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c30e0662-7e4e-45c7-aec8-efc6b84a0785</guid><dc:creator>Rihab</dc:creator><description>&lt;p&gt;hello,&amp;nbsp;&lt;br /&gt;thank you fer your reply&lt;br /&gt;i already have my button example running perfectly&amp;nbsp;&lt;br /&gt;i just need to implement a counter that increments by 1 each time the button is pressed&lt;br /&gt;i did some researches and i saw that RTC counter need to be used&amp;nbsp;&lt;br /&gt;&lt;br /&gt;do you have an example on that or can you guide me through to get it done&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0820.Senso_5F00_Display.PNG" /&gt;&lt;br /&gt;the image below is showing how my button is pressed&amp;nbsp;&lt;br /&gt;1-button pressed ( printk(&amp;quot;***************Button pressed at %&amp;quot; PRIu32 &amp;quot;\n&amp;quot;, k_cycle_get_32());&amp;nbsp; k_cycle_get_32-&amp;gt;Current hardware clock up-counter (in cycles)&amp;nbsp; )&amp;nbsp;&lt;br /&gt;2-get bme data&lt;br /&gt;3-get Mpu data&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;knowing the details can you help me please implement the counter&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: increment counter on button pressed</title><link>https://devzone.nordicsemi.com/thread/341241?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 10:34:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e4d80e9-c8f9-4d92-8c4a-3a60dfb4c40d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think you could start from this&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/basic/button/README.html"&gt;Button&lt;/a&gt;&amp;nbsp;sample.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>