<?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>Distance calculation ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70180/distance-calculation</link><description>Dear Members, 
 How can I implement this formula 
 
 into a code with timer ? 
 I get the speed (V0 and V ) from the sensor every second. 
 Any ideas ? 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Jan 2021 10:30:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70180/distance-calculation" /><item><title>RE: Distance calculation ?</title><link>https://devzone.nordicsemi.com/thread/288606?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 10:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef319f41-b887-4971-b491-3df435a7c56d</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;ok, thanks for the idea &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Distance calculation ?</title><link>https://devzone.nordicsemi.com/thread/288601?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 10:22:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b441270-06cb-4f9f-b209-e37eda594a3f</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t write the code for you. Did you check timer tutorial I linked? It should be fairly straightforward to type it in if you get a grasp on how the&amp;nbsp; app timer library works.&lt;/p&gt;
&lt;p&gt;Something like:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start the timer and retrieve the start speed V0 from sensor&lt;/li&gt;
&lt;li&gt;Stop the timer and retrieve the end speed V and the time elapsed.&lt;/li&gt;
&lt;li&gt;Calculate (V0+V)/2 and multiply it with t&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Distance calculation ?</title><link>https://devzone.nordicsemi.com/thread/288281?ContentTypeID=1</link><pubDate>Sun, 10 Jan 2021 23:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72f04369-27e1-4a0e-b275-9ec119a3e103</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;I want to get the distance but the speed is changing within time, please have a look on my xls spreadsheet attachment, &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Total-distance-in-5-seconds.xls"&gt;devzone.nordicsemi.com/.../Total-distance-in-5-seconds.xls&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How can I implement it in C with timer and array of Vo and V ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Distance calculation ?</title><link>https://devzone.nordicsemi.com/thread/288108?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2021 09:13:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a64c65aa-f67a-4751-8b17-1c4274a019e9</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assume that you&amp;#39;re asking how to retrieve the elapsed time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_timer.html?cp=7_1_3_53"&gt;app timer library&lt;/a&gt; and the function &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__app__timer.html#gae36265bac1480fbb1522f63f70ac369f"&gt;app_timer_cnt_get()&lt;/a&gt;&amp;nbsp;to get the elapsed time. The function will return the number of elapsed ticks, so you&amp;#39;ll have to convert this to ms, see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/7297/ticks-to-ms-calculation"&gt;this thread&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/application-timer-tutorial"&gt;App timer tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>