<?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 print</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15384/how-to-print</link><description>hi all, 
 Question:
i want to print &amp;quot;BUTTON IS PRESSED&amp;quot; continuously when button is pressed and i want to print &amp;quot;BUTTON IS RELEASED&amp;quot; when button is released. 
 eg: if i pressed the button 
 &amp;quot;BUTTON IS PRESSED&amp;quot;
 
 &amp;quot;BUTTON IS PRESSED&amp;quot;
&amp;quot;BUTTON IS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jul 2016 13:40:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15384/how-to-print" /><item><title>RE: how to print</title><link>https://devzone.nordicsemi.com/thread/58751?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2016 13:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5cd057a-585d-4124-807d-077a3c637e57</guid><dc:creator>Rajneesh</dc:creator><description>&lt;p&gt;Hi Ranjith,&lt;/p&gt;
&lt;p&gt;I think you should edit bsp.c file.&lt;/p&gt;
&lt;p&gt;find this function and edit like this way.
static void bsp_button_event_handler(uint8_t pin_no, uint8_t button_action)&lt;/p&gt;
&lt;p&gt;case APP_BUTTON_PUSH:
printf(&amp;quot;BUTTON IS PRESSED\r\n&amp;quot;);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;            event = m_events_list[button].push_event;
            if (m_events_list[button].long_push_event != BSP_EVENT_NOTHING)
            {
                err_code = app_timer_start(m_button_timer_id,    BSP_MS_TO_TICK(BSP_LONG_PUSH_TIMEOUT_MS), (void*)&amp;amp;current_long_push_pin_no);
                if (err_code == NRF_SUCCESS)
                {
                    current_long_push_pin_no = pin_no;
                }
            }
            release_event_at_push[button] = m_events_list[button].release_event;
            break;
        case APP_BUTTON_RELEASE:
	printf(&amp;quot;BUTTON IS RELEASE\r\n&amp;quot;);

            (void)app_timer_stop(m_button_timer_id);
            if (release_event_at_push[button] == m_events_list[button].release_event)
            {
                event = m_events_list[button].release_event;
            }
            break;
        case BSP_BUTTON_ACTION_LONG_PUSH:
	printf(&amp;quot;BUTTON IS PRESSED\r\n&amp;quot;);

            event = m_events_list[button].long_push_event;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;before use printf to print on terminal you have to initialize uart.
find Bellow attached jpg file and show output.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/BUTTON.JPG"&gt;BUTTON.JPG&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,
Rajneesh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>