Go Down

### Topic: Interfacing Atomic IMU 6DOF (Read 2424 times)previous topic - next topic

#### rahlk

##### Aug 01, 2011, 11:39 am
I made all the necessary connections between IMU and the arduino mega
I managed to connect the atomic IMU 6DOF to the mega and used the code(given below) to read the data. I am getting a set of distinct numbers that actually make no sense at all..

Code: [Select]
`int imuData[9];void setup() {  Serial.begin(115200);  Serial.println("#");  Serial.println("-");}void loop() {  for(int i=0; i<9; i++) {    imuData[i]=Serial.read();    Serial.print(imuData[i]);    Serial.print("__");}Serial.println("");delay(900);}`

-RaHL

#### PaulS

#1
##### Aug 01, 2011, 12:22 pm
Quote
I am getting a set of distinct numbers that actually make no sense at all..

You want to share that output, and explain your expectations?

#### rahlk

#2
##### Aug 04, 2011, 04:28 am

this is what i am getting. Well, as far as i know these numbers dont make any sense. i am hoping to get some numbers pertaining to angles or speed of something, know what i am talking about?

#### PaulS

#3
##### Aug 04, 2011, 12:34 pm
Quote
Well, as far as i know these numbers dont make any sense. i am hoping to get some numbers pertaining to angles or speed of something, know what i am talking about?

The problem is that your expectations are unrealistic. What you are getting is the instantaneous acceleration data and orientation data. Since acceleration is the rate of change of velocity, you need to integrate that data to get speed. There are plenty of examples around for how to do this. Some even work.

#### rahlk

#4
##### Aug 06, 2011, 09:52 am
Okay, after quite some research i found that the data from the IMU arrives in a bit mode distributed like this:-

8 bits      16bits      16bits      16bits      16bits      16bits      16bits      16bits      8bits
'A'         Count       X accl      Y accl      Z accl      Roll          Pitch        Yaw         'Z'

So i use this code snippet
Code: [Select]
`int imuVal[16];for(int i=0; i<16; i++) {     imuVal[i]= Serial.read();}`

This imuVal array will now contain the raw data, how do I convert it to something meaningful?

Go Up