<?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=7994" />

<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>2012-06-05T07:19:18+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=17&amp;t=7994</id>
<entry>
<author><name><![CDATA[acentw]]></name></author>
<updated>2012-06-05T07:19:18+01:00</updated>
<published>2012-06-05T07:19:18+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34537#p34537</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34537#p34537"/>
<title type="html"><![CDATA[Re: Request vb sample code for Module RM-G144]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34537#p34537"><![CDATA[
<dl class="codebox"><dt>Code: </dt><dd><code>' To read HMC5843<br />Imports System.Threading.Thread<br />Imports RoBoIO_DotNet.RoBoIO ' import the RoBoIO .Net Warper<br /><br />Module HMC5843<br /><br />    Sub wait_ms&#40;ByVal t As Integer&#41;<br />        Sleep&#40;t&#41;<br />    End Sub<br /><br />    Sub Main&#40;&#41;<br />        Dim i2c_address As Byte<br />        Dim buf&#40;10&#41; As Byte<br />        Dim X_data As Integer<br />        Dim Y_data As Integer<br />        Dim Z_data As Integer<br /><br />        i2c_address = &amp;H1E<br />        ' first set the correct RoBoard version<br />        roboio_SetRBVer&#40;RB_100&#41;<br />        'roboio_SetRBVer&#40;RB_110&#41;  ' if your RoBoard is RB-110<br />        'roboio_SetRBVer&#40;RB_050&#41;  ' if your RoBoard is RB-050<br />        'roboio_SetRBVer&#40;RB_100RD&#41;' if your RoBoard is RB-100RD<br /><br />        If &#40;i2c_Init&#40;I2CMODE_AUTO, 400000&#41; = False&#41; Then ' init I2C lib to 400Kbps<br />            Console.WriteLine&#40;&quot;ERROR: fail to init I2C lib &#40;&quot; &amp; roboio_GetErrMsg&#40;&#41; &amp; &quot;&#41;!&quot;&#41;<br />            GoTo I2C_END<br />        End If<br /><br />        'Setting HMC5843<br />        buf&#40;0&#41; = &amp;H2 'mode register<br />        buf&#40;1&#41; = &amp;H0 'continue-measureture mode<br />        i2c_Send&#40;i2c_address, buf, 2&#41;<br /><br />        wait_ms&#40;100&#41;<br /><br />        'Send &quot;READ&quot; Command<br />        i2c_SensorRead&#40;i2c_address, &amp;H3, buf, 6&#41;<br /><br />        'buf&#40;0&#41; = X MSB<br />        'buf&#40;1&#41; = X LSB<br />        'buf&#40;2&#41; = Y MSB<br />        'buf&#40;3&#41; = Y LSB<br />        'buf&#40;4&#41; = Z MSB<br />        'buf&#40;5&#41; = Z LSB<br />        If &#40;&#40;buf&#40;0&#41; / 128&#41; &gt; 0&#41; Then<br />            X_data = &amp;HFFFF0000 + buf&#40;0&#41; * 256 + buf&#40;1&#41;<br />        Else<br />            X_data = buf&#40;0&#41; * 256 + buf&#40;1&#41;<br />        End If<br /><br />        If &#40;&#40;buf&#40;2&#41; / 128&#41; &gt; 0&#41; Then<br />            Y_data = &amp;HFFFF0000 + buf&#40;2&#41; * 256 + buf&#40;3&#41;<br />        Else<br />            Y_data = buf&#40;2&#41; * 256 + buf&#40;3&#41;<br />        End If<br /><br />        If &#40;&#40;buf&#40;4&#41; / 128&#41; &gt; 0&#41; Then<br />            Z_data = &amp;HFFFF0000 + buf&#40;4&#41; * 256 + buf&#40;5&#41;<br />        Else<br />            Z_data = buf&#40;4&#41; * 256 + buf&#40;5&#41;<br />        End If<br /><br />        Console.WriteLine&#40;&quot;X axis : &quot; &amp; X_data&#41;<br />        Console.WriteLine&#40;&quot;Y axis : &quot; &amp; Y_data&#41;<br />        Console.WriteLine&#40;&quot;Z axis : &quot; &amp; Z_data&#41;<br /><br />        i2c_Close&#40;&#41;  'close I2C lib<br /><br />I2C_END:<br />    End Sub<br /><br />End Module<br /></code></dd></dl><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2314">acentw</a> — Tue Jun 05, 2012 7:19 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[acentw]]></name></author>
<updated>2012-06-05T07:17:12+01:00</updated>
<published>2012-06-05T07:17:12+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34536#p34536</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34536#p34536"/>
<title type="html"><![CDATA[Re: Request vb sample code for Module RM-G144]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34536#p34536"><![CDATA[
<blockquote><div><cite>eydi wrote:</cite><br />Request vb sample code for Module RM-G144 ??????<br /><br />(not usage C++  sample code  )<br /></div></blockquote><br /><br />Hi, eydi<br />I modify the sample code on the RoBoard RM-G144 page<br />(<!-- m --><a class="postlink" href="http://www.roboard.com/G144.html">http://www.roboard.com/G144.html</a><!-- m -->) as following:<br /><br />It is VB.NET (not Visual Basic 6.0) code<br /><dl class="codebox"><dt>Code: </dt><dd><code>' To read ADXL345<br />Imports System.Threading.Thread<br />Imports RoBoIO_DotNet.RoBoIO ' import the RoBoIO .Net Warper<br /><br />Module ADXL345<br /><br />    Sub wait_ms&#40;ByVal t As Integer&#41;<br />        Sleep&#40;t&#41;<br />    End Sub<br /><br />    Sub Main&#40;&#41;<br />        Dim i2c_address As Byte<br />        Dim buf&#40;10&#41; As Byte<br />        Dim X_data As Integer<br />        Dim Y_data As Integer<br />        Dim Z_data As Integer<br /><br />        i2c_address = &amp;H53<br />        ' first set the correct RoBoard version<br />        roboio_SetRBVer&#40;RB_100&#41;<br />        'roboio_SetRBVer&#40;RB_110&#41;  ' if your RoBoard is RB-110<br />        'roboio_SetRBVer&#40;RB_050&#41;  ' if your RoBoard is RB-050<br />        'roboio_SetRBVer&#40;RB_100RD&#41;' if your RoBoard is RB-100RD<br /><br />        If &#40;i2c_Init&#40;I2CMODE_AUTO, 400000&#41; = False&#41; Then ' init I2C lib to 400Kbps<br />            Console.WriteLine&#40;&quot;ERROR: fail to init I2C lib &#40;&quot; &amp; roboio_GetErrMsg&#40;&#41; &amp; &quot;&#41;!&quot;&#41;<br />            GoTo I2C_END<br />        End If<br /><br />        'Setting ADXL345<br />        buf&#40;0&#41; = &amp;H2D 'Pwoer_Control register<br />        buf&#40;1&#41; = &amp;H28 'link and measure mode<br />        i2c_Send&#40;i2c_address, buf, 2&#41;<br /><br />        wait_ms&#40;100&#41;<br /><br />        buf&#40;0&#41; = &amp;H31 'Data_Format register<br />        buf&#40;1&#41; = &amp;H8 'Full_Resolution<br />        i2c_Send&#40;i2c_address, buf, 2&#41;<br /><br />        wait_ms&#40;100&#41;<br /><br />        buf&#40;0&#41; = &amp;H38 'FIFO_Control register<br />        buf&#40;1&#41; = &amp;H0 'bypass mode<br />        i2c_Send&#40;i2c_address, buf, 2&#41;<br /><br />        wait_ms&#40;100&#41;<br /><br />        'Send &quot;READ&quot; Command<br />        i2c_SensorRead&#40;i2c_address, &amp;H32, buf, 6&#41;<br /><br />        'buf&#40;0&#41; = X LSB<br />        'buf&#40;1&#41; = X MSB<br />        'buf&#40;2&#41; = Y LSB<br />        'buf&#40;3&#41; = Y MSB<br />        'buf&#40;4&#41; = Z LSB<br />        'buf&#40;5&#41; = Z MSB<br />        If &#40;&#40;buf&#40;1&#41; / 128&#41; &gt; 0&#41; Then<br />            X_data = &amp;HFFFF0000 + buf&#40;1&#41; * 256 + buf&#40;0&#41;<br />        Else<br />            X_data = buf&#40;1&#41; * 256 + buf&#40;0&#41;<br />        End If<br /><br />        If &#40;&#40;buf&#40;3&#41; / 128&#41; &gt; 0&#41; Then<br />            Y_data = &amp;HFFFF0000 + buf&#40;3&#41; * 256 + buf&#40;2&#41;<br />        Else<br />            Y_data = buf&#40;3&#41; * 256 + buf&#40;2&#41;<br />        End If<br /><br />        If &#40;&#40;buf&#40;5&#41; / 128&#41; &gt; 0&#41; Then<br />            Z_data = &amp;HFFFF0000 + buf&#40;5&#41; * 256 + buf&#40;4&#41;<br />        Else<br />            Z_data = buf&#40;5&#41; * 256 + buf&#40;4&#41;<br />        End If<br /><br />        Console.WriteLine&#40;&quot;Acc of X-axis : &quot; &amp; X_data&#41;<br />        Console.WriteLine&#40;&quot;Acc of Y-axis : &quot; &amp; Y_data&#41;<br />        Console.WriteLine&#40;&quot;Acc of Z-axis : &quot; &amp; Z_data&#41;<br /><br />        i2c_Close&#40;&#41;  'close I2C lib<br /><br />I2C_END:<br />    End Sub<br /><br />End Module<br /></code></dd></dl><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2314">acentw</a> — Tue Jun 05, 2012 7:17 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[eydi]]></name></author>
<updated>2012-06-01T05:33:31+01:00</updated>
<published>2012-06-01T05:33:31+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34521#p34521</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34521#p34521"/>
<title type="html"><![CDATA[Request vb sample code for Module RM-G144]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34521#p34521"><![CDATA[
please  help help help<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=3394">eydi</a> — Fri Jun 01, 2012 5:33 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[eydi]]></name></author>
<updated>2012-05-30T19:27:26+01:00</updated>
<published>2012-05-30T19:27:26+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34519#p34519</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34519#p34519"/>
<title type="html"><![CDATA[Request vb sample code for Module RM-G144]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=7994&amp;p=34519#p34519"><![CDATA[
Request vb sample code for Module RM-G144 ??????<br /><br />(not usage C++  sample code  )<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=3394">eydi</a> — Wed May 30, 2012 7:27 pm</p><hr />
]]></content>
</entry>
</feed>