I just got this sensor and trying to figure out some basic things.
I want to make my own AHRS but i’m stuck in a probably trivial thing, which tho is basicly too.
Having the sensor connected to an Arduino board i only try to read the values the sensor outputs in SCL and SDA pins. I’m trying to find out in which form is the output throughout Datasheet but i can’t find anything.
Can you please help me and explain what are the values and in which type,that being outputed on those pins so i can read them correctly?
The code i’m using is this;
void setup(){
Serial.begin(9600);
}
void loop() {
int an4 = analogRead(A4);
int an5 = analogRead(A5);
Now as it consides my problem, unfortunately i’v already tried the Arduino code but that doesn’t serve my purpose.
What i want to do is this;
Print in serial the output that the sensor gives me and take that output and proccess it in Matlab.
In order to proccess it, i need the data aquired from the sensor.
The problem is that i’m beginer in all these, it’s a part of my Thesis, and the I2C code used for arduino is too complicated for me to understand it because it includes many AHRS essentials inside.
I’v already read alot about I2C in order to understand how it works and still having problems.
Can you please point a way to write a simple code in order just to read the data?
I will use an ARM proccessor “Stellaris LM4F120” for the implementation.
although all the starting coding and testing will be done in Arduino.
I am not sure what code you are looking at. I recommend looking at the individual libraries for the LSM303* and the L3G*; combining the examples together in your own sketch as needed.