Parallax Compass Module 3-Axis HMC5883L #29133
So in our ever continuing quest to play with different peripherals and sensors - we have the compass module! Now according to the site:
"The Compass Module 3-Axis HMC5883L is designed for low-field magnetic sensing with a digital interface. This compact sensor fits into small projects such as UAVs and robot navigation systems.
The sensor converts any magnetic field to a differential voltage output on 3 axes. This voltage shift is the raw digital output value, which can then be used to calculate headings or sense magnetic fields coming from different directions."
We'll go again to the Kickstart Site so I'm not reinventing the wheel and it would seem that all I had to do for wiring was take the gyroscope module OFF, and plug this in almost EXACTLY the same place. How convenient is that?!
I'm still finagling with it but here are a couple of options for experimentation:
https://sites.google.com/site/parallaxinretailstores/Compass-Propeller.zip?attredirects=0
With that kickstart code the -101, -158, -520 stands for the voltage outputs on the three axis. ...I still don't really know what that means...
http://www.parallax.com/portals/0/downloads/docs/prod/sens/29133-CompassSpinDemo.zip
Cool! So when you rotate this one around, you see the X/Y/Z changing a bit (though its meaning is still beyond me), but you get to see the Heading in Degrees change from North to different degrees of NW or NE, to South and so on!
So I didn't look carefully (though I thought I had) at the wiring. Remember to know which pins your SCL and SDA are connected to. When you flipflop them, this is what you get. It stays stuck at NORTH and no matter what you do to the module, the X/Y/Z are all at -1. I'm still not sure what the square symbols are....but I'm sure I'll be able to find them.
You will need to put "SL32_INTEngine_2.spin" into your PropTool Library. Based on the innards, it looks like it takes care of any geometric math that may be required in the main program. And with the Compass Spin Demo, you need to make sure that the Parallax Serial Terminal is running on the same baud rate, otherwise you won't see anything happening (as I found out!).
I will keep working on it!