View Single Post
  #14   Spotlight this post!  
Unread 05-02-2016, 07:44
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: MPU-9150 (I2C) with Labview

Quote:
Originally Posted by Ian R. View Post
Ok, I tested it out today, and we finally got a response from the mag.
But anither issue arised. While we can read from all the low byte registers, the high ones always return 0.
We tried communicating with the mag directly, as well as through the MPU, but it's the same problem.
I'm not sure if we have to read each independent register and then shift the high one and add the low one to it, or if we should read the low register and ask for 2 bytes.
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:
Quote:
Originally Posted by Section 8.1
Addresses from 00H to 0CH and from 10H to 12H are compliant with automatic increment function of serial interface respectively.
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?
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote