Quote:
Originally Posted by RyanN
Sparkfun's example code does a 6-byte burst read. I just checked the AK8975's datasheet and it says is compatible with burst read:
The AK8975 returns a signed 16-bit integer, so negative numbers should return something in the MSB. That's pretty easy to replicate by rotating the sensor 180 degrees.
I'm not sure what's going on from your description. Mind sharing your current LabVIEW code?
|
Alright, we just rested it and we get values from 79 to -21 when rotating it a full 360 degrees. There's another problem too, the mag returns two equal values for each orientation and it's oposite. So, for instance, if the mag is pointing at 90º, it returns, say, 30. But if it's pointing at -90º, it also returns 30.
Here's the code. We are setting the mag as a slave so we can read the values from the MPU. We alsot tried reading the values directly from the mag, but it's the exact same issue:
Periodic tasks:
MPU Initialize:
Read Compass VI:
Read Burst VI:
