<?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>Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54218/programming-nrf5e-with-accelerometer</link><description>Hi guys, I just ordered doc.mokotechnology.com/index.php device which is nrf52 + accelerometer + firmware that is just broadcasting the location over BLE. This is almost what I want, I just need to customize the device a little. What I need is just the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Jul 2023 08:18:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54218/programming-nrf5e-with-accelerometer" /><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/438914?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2023 08:18:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdc85864-da15-4f2c-8547-5cf5300807ae</guid><dc:creator>Trinh Kieu</dc:creator><description>&lt;p&gt;Thank you, I had the same problem.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.sungoldsolar.com/"&gt;https://www.sungoldsolar.com/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/272066?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 12:49:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b618a97e-bc8a-4b05-b105-6013f282b189</guid><dc:creator>Scott--R</dc:creator><description>&lt;p&gt;Hi Milen. Did you ever get this working? I would like to do something similar with the same device from Moko, only I want it to START advertising when it detects motion, not stop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/223580?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2019 12:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2242f37a-d600-4426-a027-c550f6b7de45</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="yanchevm"]1. In the example &lt;a href="https://github.com/NordicPlayground/nRF52-Bluetooth-Course"&gt;https://github.com/NordicPlayground/nRF52-Bluetooth-Course&lt;/a&gt;, I&amp;#39;m creating in step by step new service. Do I need to be connect to the device in order to use this service ?[/quote]
&lt;p&gt;In the tutorial, you need the&amp;nbsp;&lt;span&gt;nRF Connect app (for &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile"&gt;mobile&lt;/a&gt;/&lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-desktop"&gt;Desk &lt;/a&gt;).&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="yanchevm"]2. What I need is without connecting the device, when it advertise to be able to read the data. Is there any example for that ?[/quote]
&lt;p&gt;&amp;nbsp;Please see this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/7381/add-a-service-and-characteristics-to-advertising-data"&gt;post&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="yanchevm"]3. Is there any example of how to configure and handle accelerometer events ?[/quote]
&lt;p&gt;&amp;nbsp;There is no example of your requirement on our side. You could create an event and handle it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nRF52-Bluetooth-Course#step-5---handling-events-from-the-softdevice"&gt;https://github.com/NordicPlayground/nRF52-Bluetooth-Course#step-5---handling-events-from-the-softdevice&lt;/a&gt;&amp;nbsp;shows how to handle the event from Softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/223430?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 20:15:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd72a222-baae-4035-b328-e241022af57d</guid><dc:creator>yanchevm</dc:creator><description>&lt;p&gt;I finally manage to make it compile and work. The problem was in the header file: &lt;/p&gt;
&lt;p&gt;The definition of the macros needs to be at the top of the header file:&lt;/p&gt;
&lt;p&gt;#define BLE_CUS_DEF(_name)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;static ble_cus_t _name;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That solves my problem with &lt;strong&gt;&amp;lsquo;m_cus&amp;rsquo; undeclared (first use in this function) error.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To continue from here, can you please clarify two things to me:&lt;/p&gt;
&lt;p&gt;1. In the example &lt;a href="https://github.com/NordicPlayground/nRF52-Bluetooth-Course"&gt;https://github.com/NordicPlayground/nRF52-Bluetooth-Course&lt;/a&gt;, I&amp;#39;m creating in step by step new service. Do I need to be connect to the device in order to use this service ?&lt;/p&gt;
&lt;p&gt;2. What I need is without connecting the device, when it advertise to be able to read the data. Is there any example for that ?&lt;/p&gt;
&lt;p&gt;3. Is there any example of how to configure and handle accelerometer events ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Milen&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/222611?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 12:30:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26de79a3-9eb1-4c7b-8be8-ddc81fc22b15</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The tutorial is developed by&amp;nbsp;&lt;span&gt;SDK_15.0.0. You should&amp;nbsp;&lt;/span&gt;&lt;span&gt;Download nRF5_SDK_15.0.0_17b948a from the&amp;nbsp;&lt;/span&gt;&lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/" rel="nofollow"&gt;download page&lt;/a&gt;&lt;span&gt;&amp;nbsp;and extract the zip to your drive, e.g. C:\NordicSemi\nRF5_SDK_15.0.0_a53641a.&lt;/span&gt;&lt;/p&gt;
[quote user="yanchevm"]What else should I configure ? Where this &lt;strong&gt;m_cus&lt;/strong&gt; defined ?[/quote]
&lt;p&gt;add a custom service instance called m_cus, i.e. add the following line below the defines in main.c&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;BLE_CUS_DEF&lt;/span&gt;(m_cus);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/222495?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 03:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23e24a67-3af2-4632-802b-f527fbc75d99</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Try tutorial from these pages instead &lt;a href="https://embeddedsoftdev.blogspot.com/2018/01/"&gt;https://embeddedsoftdev.blogspot.com/2018/01/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/222453?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 18:45:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3500869e-1795-42e3-b3d7-1937b9ff9fdc</guid><dc:creator>yanchevm</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using &lt;strong&gt;SDK v16.0.0. &lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have installed SDK v15.0.0 and the GIt example is compiled now. However, I&amp;#39;m still getting issues with the step by step guide. I notices that in the Git example, I have nRF_BLE_Serives folder and my ble_cus.c file is there, however, when I&amp;#39;m making the files manually, both files (.c and .h) are in the Application folder.&lt;/p&gt;
&lt;p&gt;Here is when I&amp;#39;m manually creating the files and I hit &lt;strong&gt;&amp;lsquo;m_cus&amp;rsquo; undeclared (first use in this function) error.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1574881878617v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Here is how it look in the Git example. It is compiled without an issues.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1574881926682v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;What else should I configure ? Where this &lt;strong&gt;m_cus&lt;/strong&gt; defined ? &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;MIlen Yanchev&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/221734?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 06:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9de9c6ab-7e0d-472d-994b-3398c679abb2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Milen,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Which SDK are you using?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Did you clone that repo into &lt;strong&gt;SDK v15.0.0&lt;/strong&gt;/examples/ble_peripheral?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/221722?ContentTypeID=1</link><pubDate>Sun, 24 Nov 2019 21:28:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cb639e3-1829-4861-8667-0b3699a65b2d</guid><dc:creator>yanchevm</dc:creator><description>&lt;p&gt;Thanks for sharing this course Amanda. It&amp;#39;s really useful for someone new to see the big picture. &lt;/p&gt;
&lt;p&gt;However, the example doesn&amp;#39;t work. Following the step by step guide, when I try to compile it, I get -&amp;nbsp;&lt;strong&gt;&amp;lsquo;m_cus&amp;rsquo; undeclared (first use in this function).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Then I clone the Git repo and try again, this time I hit another issue with the logging header.&lt;/p&gt;
&lt;p&gt;- &lt;strong&gt;/home/components/libraries/experimental_log/src/nrf_log_backend_rtt.c: No such file or directory&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Can you please fix it ?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Milen Yanchev&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/220718?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 07:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53509654-bdcc-4bd6-986b-e843f5929e1d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Milen,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is no example of your requirement. You could refer to the&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nRF52-Bluetooth-Course"&gt;nRF52-Bluetooth-Course tutorial&lt;/a&gt;&amp;nbsp;and use an event handler to stop advertising (&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v0.9.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#gaa88eea8e9e95dd96a7633e2c62f3ce16"&gt;sd_ble_gap_adv_stop&lt;/a&gt;() function).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/220441?ContentTypeID=1</link><pubDate>Sun, 17 Nov 2019 21:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d7fe74b-e7ad-4f28-bd4f-aef247f92171</guid><dc:creator>yanchevm</dc:creator><description>&lt;p&gt;Amanda, thanks for the provided posts, but I&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt; don&amp;#39;t think they are enough for a beginner to write something.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;For example, in the post for stopping the advertising, they are explaining some functions that eventually can stop it, but I don&amp;#39;t see anything for accelerometer and how it can be integrated with this ble_app_uart project and be used as stopping flag.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;I will really appreciate if there is something like that for a beginners. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Milen Yanchev&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/219554?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 21:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2807dfdb-fb8a-4a7c-9197-bff7857c511e</guid><dc:creator>yanchevm</dc:creator><description>&lt;p&gt;Thanks a lot for your info! I will check the posts &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nrf5e with accelerometer</title><link>https://devzone.nordicsemi.com/thread/219501?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 14:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd01c884-db4d-40c7-bd14-a94632f771a6</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]What I need is just the BLE to advertise simple encrypted UUID[/quote]
&lt;p&gt;Please see this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45470/encryption-and-decryption-of-advertising-data"&gt;post &lt;/a&gt;and this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38329/related-to-ble-advertising-encryption-and-decryption/148205#148205"&gt;post&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user=""]and when the accelerometer detects movement, the device to stop advertising.[/quote]
&lt;p&gt;&amp;nbsp;Please see this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/15248/how-to-stop-advertising"&gt;post&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>