<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: hmc5883L code issue</title>
		<link>http://forums.leaflabs.com/topic.php?id=1197</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:23:22 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1197" rel="self" type="application/rss+xml" />

		<item>
			<title>TroyLee on "hmc5883L code issue"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1197#post-8405</link>
			<pubDate>Tue, 28 Feb 2012 02:20:18 +0000</pubDate>
			<dc:creator>TroyLee</dc:creator>
			<guid isPermaLink="false">8405@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;https://github.com/LeeTroy/ArduIMU/tree/master/libraries/HMC5883L&#34; rel=&#34;nofollow&#34;&#62;https://github.com/LeeTroy/ArduIMU/tree/master/libraries/HMC5883L&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;A simple library implement for HMC5883L.&#60;/p&#62;
&#60;p&#62;I've tested on a teensy++.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farid on "hmc5883L code issue"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1197#post-7356</link>
			<pubDate>Thu, 15 Dec 2011 01:13:53 +0000</pubDate>
			<dc:creator>Farid</dc:creator>
			<guid isPermaLink="false">7356@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;thanks i will try again
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "hmc5883L code issue"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1197#post-7316</link>
			<pubDate>Mon, 12 Dec 2011 18:38:18 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">7316@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;a lot of these accelerometer have &#34;enable&#34; modes such that you need to turn them on before youll get data updates. Perhaps thats whats going on here?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ala42 on "hmc5883L code issue"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1197#post-7287</link>
			<pubDate>Thu, 08 Dec 2011 18:02:37 +0000</pubDate>
			<dc:creator>ala42</dc:creator>
			<guid isPermaLink="false">7287@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Your initialization code is a bit short. Add the initializations used in the AeroQuad code &#60;a href=&#34;http://code.google.com/p/aeroquad/source/browse/trunk/AeroQuad/Compass.h&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/aeroquad/source/browse/trunk/AeroQuad/Compass.h&#60;/a&#62; starting at line 200.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farid on "hmc5883L code issue"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1197#post-7281</link>
			<pubDate>Tue, 06 Dec 2011 20:52:19 +0000</pubDate>
			<dc:creator>Farid</dc:creator>
			<guid isPermaLink="false">7281@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;no one……
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farid on "hmc5883L code issue"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1197#post-7267</link>
			<pubDate>Wed, 30 Nov 2011 22:45:12 +0000</pubDate>
			<dc:creator>Farid</dc:creator>
			<guid isPermaLink="false">7267@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The following is my code :&#60;br /&#62;
#include &#38;lt;Wire.h&#38;gt;&#60;/p&#62;
&#60;p&#62;#define HMC5883_WriteAddress 0x1E //  i.e 0x3C &#38;gt;&#38;gt; 1&#60;br /&#62;
#define HMC5883_ModeRegisterAddress 0x02&#60;br /&#62;
#define HMC5883_ContinuousModeCommand 0x00&#60;br /&#62;
#define HMC5883_DataOutputXMSBAddress  0x03&#60;/p&#62;
&#60;p&#62;int outputData[6];&#60;/p&#62;
&#60;p&#62;void setup()&#60;br /&#62;
{  &#60;/p&#62;
&#60;p&#62;    //SerialUSB.begin(9600);&#60;br /&#62;
    Wire.begin();       //Initiate the Wire library and join the I2C bus as a master&#60;/p&#62;
&#60;p&#62;     Wire.beginTransmission(HMC5883_WriteAddress); //Initiate a transmission with HMC5883 (Write address).&#60;br /&#62;
    Wire.send(HMC5883_ModeRegisterAddress);       //Place the Mode Register Address in send-buffer.&#60;br /&#62;
    Wire.send(HMC5883_ContinuousModeCommand);     //Place the command for Continuous operation Mode in send-buffer.&#60;br /&#62;
    Wire.endTransmission();                       //Send the send-buffer to HMC5883 and end the I2C transmission.&#60;br /&#62;
    delay(1000);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void loop() {&#60;/p&#62;
&#60;p&#62;    int i,x,y,z; &#60;/p&#62;
&#60;p&#62;    Wire.beginTransmission(HMC5883_WriteAddress);  //Initiate a transmission with HMC5883 (Write address).&#60;br /&#62;
	Wire.send(HMC5883_DataOutputXMSBAddress); //select register 3, X MSB register&#60;br /&#62;
	Wire.endTransmission();&#60;/p&#62;
&#60;p&#62;	Wire.requestFrom(HMC5883_WriteAddress,6);      //Request 6 bytes of data from the address specified,2 registers per axis. &#60;/p&#62;
&#60;p&#62;    //Read the value of magnetic components X,Y and Z&#60;/p&#62;
&#60;p&#62;    if(6 &#38;lt;= Wire.available()) // If the number of bytes available for reading be &#38;lt;=6.&#60;br /&#62;
    {&#60;br /&#62;
        for(i=0;i&#38;lt;6;i++)&#60;br /&#62;
        {&#60;br /&#62;
            outputData[i]=Wire.receive();  //Store the data in outputData buffer&#60;br /&#62;
        }&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    x=outputData[0] &#38;lt;&#38;lt; 8 &#124; outputData[1]; //Combine MSB and LSB of X Data output register&#60;br /&#62;
    z=outputData[2] &#38;lt;&#38;lt; 8 &#124; outputData[3]; //Combine MSB and LSB of Z Data output register&#60;br /&#62;
    y=outputData[4] &#38;lt;&#38;lt; 8 &#124; outputData[5]; //Combine MSB and LSB of Y Data output register&#60;br /&#62;
	SerialUSB.print(&#34;X=&#34;);&#60;br /&#62;
	SerialUSB.print(x);&#60;br /&#62;
	SerialUSB.print(&#34;  Y=&#34;);&#60;br /&#62;
	SerialUSB.print(y);&#60;br /&#62;
	SerialUSB.print(&#34;  Z=&#34;);&#60;br /&#62;
	SerialUSB.println(z);&#60;/p&#62;
&#60;p&#62;    delay(100);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;But the result x y z is the same when i shake the HMC5883L-board.&#60;br /&#62;
Is anyone who have been use this IC before can tell me what's wrong with the code ,&#60;br /&#62;
thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
