<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=17&amp;t=9623" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2013-07-27T07:53:32+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=17&amp;t=9623</id>
<entry>
<author><name><![CDATA[goldpower]]></name></author>
<updated>2013-07-27T07:53:32+01:00</updated>
<published>2013-07-27T07:53:32+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38415#p38415</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38415#p38415"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38415#p38415"><![CDATA[
<blockquote><div><cite>RN1AsOf091407 wrote:</cite><br />I saw your other post. I'll try to re-explain:<br /><br />At rest, when sitting still, you will get some value from X, Y, and Z. To generate + and - values relative to rest position, do this:<br /><br />RelativeValueX = CurrentX - AtRestX<br /><br />RelativeValueX will be + when axis is greater than AtRestX, and - when axis is less than AtRestX.<br /><br />Do the same for Y and Z.<br /><br />All accelerometers exhibit some value when at rest, as gravity is always affecting them. An axis perfectly perpendicular to the force of gravity and not moving should be zero, but it is unlikely you'll actually see zero at this position due to fabrication, tolerances, etc. It is sufficient in practice to zero-reference by using &quot;at rest&quot; values.<br /><br />This is similar to how RC gyros work in helicopters and such, and is why you're supposed to leave the gyro alone for a few seconds when powering on - because it is recording its &quot;at rest&quot; position to use as a reference.<br /></div></blockquote><br /><br />please sample code<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4069">goldpower</a> — Sat Jul 27, 2013 7:53 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[PaulL]]></name></author>
<updated>2013-07-27T07:12:03+01:00</updated>
<published>2013-07-27T07:12:03+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38414#p38414</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38414#p38414"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38414#p38414"><![CDATA[
I saw your other post. I'll try to re-explain:<br /><br />At rest, when sitting still, you will get some value from X, Y, and Z. To generate + and - values relative to rest position, do this:<br /><br />RelativeValueX = CurrentX - AtRestX<br /><br />RelativeValueX will be + when axis is greater than AtRestX, and - when axis is less than AtRestX.<br /><br />Do the same for Y and Z.<br /><br />All accelerometers exhibit some value when at rest, as gravity is always affecting them. An axis perfectly perpendicular to the force of gravity and not moving should be zero, but it is unlikely you'll actually see zero at this position due to fabrication, tolerances, etc. It is sufficient in practice to zero-reference by using &quot;at rest&quot; values.<br /><br />This is similar to how RC gyros work in helicopters and such, and is why you're supposed to leave the gyro alone for a few seconds when powering on - because it is recording its &quot;at rest&quot; position to use as a reference.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=741">PaulL</a> — Sat Jul 27, 2013 7:12 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[goldpower]]></name></author>
<updated>2013-07-08T05:34:25+01:00</updated>
<published>2013-07-08T05:34:25+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38303#p38303</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38303#p38303"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38303#p38303"><![CDATA[
yes.<br /><br />sample code c++ :<br /><a href="http://www.mediafire.com/download/13y5jma624vvw3c/RM-G146_sample_code.zip" class="postlink">http://www.mediafire.com/download/13y5jma624vvw3c/RM-G146_sample_code.zip</a><br /><br />Datasheet LSM303DLH :<br /><a href="http://www.mediafire.com/download/at2gb231kdxk1jo/LSM303DLH.pdf" class="postlink">http://www.mediafire.com/download/at2gb231kdxk1jo/LSM303DLH.pdf</a><br /><br />Please explain more about negative values &#8203;&#8203;axes.<br /><br />sample code c++ for values &#8203;&#8203;from 0 to 65535<br /><dl class="codebox"><dt>Code: </dt><dd><code>#include &lt;stdio&gt;<br />#include &lt;conio&gt;<br /><br />#if defined&#40;WIN32&#41;<br />    #include &lt;roboard_dll&gt;  // use the DLL version of RoBoIO lib<br />    // #include &lt;roboard&gt;   // use the static version of RoBoIO lib<br />#else<br />    #include &lt;roboard&gt;<br />#endif<br /><br />const unsigned char acceler_addr = 0x30&gt;&gt;1;<br /><br />int main&#40;&#41;<br />&#123;<br />   unsigned int acceler_X, acceler_Y, acceler_Z, d;<br />   <br />   roboio_SetRBVer&#40;RB_110&#41;; <br />   <br />    if &#40;i2c_Initialize&#40;I2CIRQ_DISABLE&#41; == false&#41;<br />   &#123;<br />      printf&#40;&quot;FALSE!!  %s\n&quot;, roboio_GetErrMsg&#40;&#41;&#41;;<br />      return -1;<br />   &#125;<br />   <br />   i2c0_SetSpeed&#40;I2CMODE_AUTO, 400000L&#41;; // set i2c speed:400k<br />   // set acceler<br />   if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,2&#41; == false&#41;<br />   &#123;<br />      printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />      goto END;<br />   &#125;<br />   i2c0master_WriteN&#40;0x20&#41;;<br />   i2c0master_WriteN&#40;0x37&#41;;<br /><br />      do<br />   &#123;<br />      //////////////////////////////////////////////////////////////////////// read acceler_X<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_WriteN&#40;0x29&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_READ,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;&#40;acceler_X = i2c0master_ReadN&#40;&#41;&#41; == 0xffff&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      acceler_X = acceler_X &lt;&lt; 8;<br />      <br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_WriteN&#40;0x28&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_READ,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;&#40;d = i2c0master_ReadN&#40;&#41;&#41; == 0xffff&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      acceler_X = acceler_X + d;<br />      <br />      //////////////////////////////////////////////////////////////////////// read acceler_Y<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_WriteN&#40;0x2b&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_READ,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;&#40;acceler_Y = i2c0master_ReadN&#40;&#41;&#41; == 0xffff&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      acceler_Y = acceler_Y &lt;&lt; 8;<br />      <br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_WriteN&#40;0x2a&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_READ,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;&#40;d = i2c0master_ReadN&#40;&#41;&#41; == 0xffff&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      acceler_Y = acceler_Y + d;<br />      <br />      //////////////////////////////////////////////////////////////////////// read acceler_Z<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_WriteN&#40;0x2d&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_READ,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;&#40;acceler_Z = i2c0master_ReadN&#40;&#41;&#41; == 0xffff&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      acceler_Z = acceler_Z &lt;&lt; 8;<br />      <br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_WRITE,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_WriteN&#40;0x2c&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;i2c0master_StartN&#40;acceler_addr, I2C_READ,1&#41; == false&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      if&#40;&#40;d = i2c0master_ReadN&#40;&#41;&#41; == 0xffff&#41;<br />      &#123;<br />         printf&#40;&quot;g-sensor error:%s !!\n&quot;,roboio_GetErrMsg&#40;&#41;&#41;;<br />         goto END;<br />      &#125;<br />      acceler_Z = acceler_Z + d;<br /><br />   <br />      printf&#40;&quot;acceler:X-axis:%d Y-azis:%d Z-axis:%d\n\n&quot;,acceler_X, acceler_Y, acceler_Z&#41;;<br />      <br />      delay_ms&#40;10&#41;;<br />   &#125;while&#40;_getch&#40;&#41; != 27&#41;;<br />END:<br />   i2c_Close&#40;&#41;;<br />   return 0;<br />&#125;</code></dd></dl><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4069">goldpower</a> — Mon Jul 08, 2013 5:34 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[PaulL]]></name></author>
<updated>2013-07-08T02:45:00+01:00</updated>
<published>2013-07-08T02:45:00+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38302#p38302</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38302#p38302"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38302#p38302"><![CDATA[
What are you connecting this board to?<br /><br />I haven't tried this board, but it's an I2C board, so it connects the same way as any I2C board. <br /><br />I'm getting an error saying corrupted zip file when I try to download their code for this module.,,<br /><br />As for the accelerometer values:<br /><br />The &quot;at rest&quot; position will be some value between 0 and 65535 (16 bits). This value becomes your zero point, if you want to see acceleration as positive and negative values (meaning, Current Value - &quot;at rest&quot; value  = zero referenced result).<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=741">PaulL</a> — Mon Jul 08, 2013 2:45 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[goldpower]]></name></author>
<updated>2013-07-07T22:52:20+01:00</updated>
<published>2013-07-07T22:52:20+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38300#p38300</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38300#p38300"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38300#p38300"><![CDATA[
I only know the VB.NET language And I do not know the C++ language.<br /><br />(The sensor 146 I've tested the sample code c++ because it does not suffer from the negative axis accelerometer values &#8203;&#8203;and only values &#8203;&#8203;from 0 to 65535?)<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4069">goldpower</a> — Sun Jul 07, 2013 10:52 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[PaulL]]></name></author>
<updated>2013-07-07T17:37:44+01:00</updated>
<published>2013-07-07T17:37:44+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38298#p38298</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38298#p38298"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38298#p38298"><![CDATA[
More information is needed. What are you trying to do?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=741">PaulL</a> — Sun Jul 07, 2013 5:37 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[goldpower]]></name></author>
<updated>2013-07-07T16:40:20+01:00</updated>
<published>2013-07-07T16:40:20+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38297#p38297</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38297#p38297"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38297#p38297"><![CDATA[
help  help  help  ...<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4069">goldpower</a> — Sun Jul 07, 2013 4:40 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[goldpower]]></name></author>
<updated>2013-07-03T15:29:41+01:00</updated>
<published>2013-07-03T15:29:41+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38260#p38260</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38260#p38260"/>
<title type="html"><![CDATA[vb.net sample code for Module RM-G146]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9623&amp;p=38260#p38260"><![CDATA[
hi<br /><br />how do modify vb.net sample code for Module RM-G146 ???<br />(<!-- m --><a class="postlink" href="http://www.roboard.com/G146.html">http://www.roboard.com/G146.html</a><!-- m -->)<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4069">goldpower</a> — Wed Jul 03, 2013 3:29 pm</p><hr />
]]></content>
</entry>
</feed>