Code explanation and Openlog data reading problem
Hello Fabio,
I hope you are doing fine and many thanks for solving my problem earlier. I have couple of question from the code you provided me last time. I need to understand them as i have to explain in my project report. In earlier message you gave me this code:
#include <FreeSixIMU.h>
#include <FIMU_ADXL345.h>
#include <FIMU_ITG3200.h>
#include <Wire.h>
float angles[3]; // yaw pitch roll
int raw[6];//***
// Set the FreeSixIMU object
FreeSixIMU sixDOF = FreeSixIMU();
void setup() {
Serial.
Wire.begin();
delay(1);
sixDOF.init(); //begin the IMU
delay(1);
//**Serial.
}
void loop() {
sixDOF.
delay(200);
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
Serial.
delay(200);
}
You will get 6 values:
acc_x, acc_y, acc_z, gyro_x, gyro_y, gyro_z
You can convert the acc values into g (gravity) units by dividing them
by 256.
You can convert the gyro values into deg/sec by dividing them by 14.375.
Ok now i understand that in order to get acc value i have to divide by 256 because its 8 bits.. and 2^8 = 256... Can you explain y do we have to divide if i am wrong. What value of g i will get i.e.(1g, 2g, 4g, ???). Also can you explain in order to get gyro values by do we have to divide by 14.375. Can i ask you to please explain me in detail so that it would help me elaborate in my report.
My 2nd question : I have connected OpenLog from sparkfun with Arduino Pro mini to save data on SD card. The good news open log is working fine and managed to save some data. But data is coming in one line rather than saving 6 reading is one line. I will post some results to explain what i mean. Results are as follows:
293,-49,
It should be like this
293,-49,
92,-51,31,23,5,42
92,-49,29,23,9,82
93,-49,33,23,5,-172
93,-48,29,19,4,-42
92,-48,30,20,6,142
93,-49,30,23,1,-6
I m running OpenLOg at 9600 Baud.
Please help me thanks
Regards
Suleman Mehmood
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- FreeIMU Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Fabio Varesano
- Solved:
- Last query:
- Last reply: