<?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>nrf51822 ble read the data send from smartphone</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5868/nrf51822-ble-read-the-data-send-from-smartphone</link><description>Hi all, 
 I am new to nRF51822,now I want to used a simple ble application to send a data,and nRF51822 ble device read this data to control RC servo motor ,for example app send value 1 then RC servo motor clockwise and send value 2 then RC servo motor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Mar 2015 15:57:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5868/nrf51822-ble-read-the-data-send-from-smartphone" /><item><title>RE: nrf51822 ble read the data send from smartphone</title><link>https://devzone.nordicsemi.com/thread/20472?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2015 15:57:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42e4a2ce-2a2f-47bc-8d6b-2085d21df46f</guid><dc:creator>Vebj&amp;#248;rn</dc:creator><description>&lt;p&gt;Are you using the nRF51822 Evaluation Kit?&lt;/p&gt;
&lt;p&gt;I would recommend to start with the ble_app_uart example in the SDK. It has a corresponding android app which you can download the source code for &lt;a href="https://www.nordicsemi.com/eng/Products/nRFready-Demo-APPS/nRF-UART-2.0-for-Android-4.3/%28language%29/eng-GB"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the UART example, in main.c there is a &lt;em&gt;nus_data_handler&lt;/em&gt; function which you can modify to handle incoming data from the mobile app.&lt;/p&gt;
&lt;p&gt;You can then modify the mobile app so it has a button that sends the text &amp;quot;right&amp;quot;, and in the handler function above you can check if p_data = &amp;quot;right&amp;quot; and then call a function which turns the motor to the right (you would have to write this function yourself, though. Try searching for PWM here on devzone, and you will find a lot of good answers)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 ble read the data send from smartphone</title><link>https://devzone.nordicsemi.com/thread/20473?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2015 15:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cc8b9fc-088b-413b-94fa-b2a876bfeca0</guid><dc:creator>Victor Nascimento</dc:creator><description>&lt;p&gt;Welcome, Peter&lt;/p&gt;
&lt;p&gt;BLE introduces a new way of communicating. The smartphone will act as a Central, while the board will act as a Peripheral.
The peripheral has to have a service with characteristics which can then be accessed from the central. In the smartphone, you have to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Discover your peripheral and its services&lt;/li&gt;
&lt;li&gt;Find its characteristics&lt;/li&gt;
&lt;li&gt;Write a value to a characteristic&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The peripheral then will be notified when the write occurs, so you can take further actions.&lt;/p&gt;
&lt;p&gt;You can find many examples on the SDK files.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>