MPU 6050 - Transforming the raw value

Hi,

I bought an IMU (the MPU-6050) and i find how to read the raw value of my sensor. I want to take this raw value and transform it in degree per second. The problem is that i don't know how to transform the raw values in 0 to 1023 value, and I'm not sure what I have to do after.

Maybe, if you can help me also with the accelerometer, that will be great

I find my code for the raw value here:
http://playground.arduino.cc/Main/MPU-6050
And the datasheet here:
http://invensense.com/mems/gyro/documents/PS-MPU-6000A.pdf

Thank you for your help.

Bernard

Please, help me...

The 16-bit ADC for each axis gives you a number from -32768 to +32767. You select a sensitivity (±250, ±500, ±1000, or ±2000) and you map one range to the other:

int DegreesPerSecond = map(rawValue, -32768, +32767, -250, +250);
or
int DegreesPerSecond = map(rawValue, -32768, +32767, -500, +500);
or
int DegreesPerSecond = map(rawValue, -32768, +32767, -1000, +1000);
or
int DegreesPerSecond = map(rawValue, -32768, +32767, -2000, +2000);

There is usually a zero offset to worry about: when the gyroscope isn't being turned it still returns a non-zero value. Subtract that from rawValue before mapping.

you can browse i2cdevlib/Arduino at master · jrowberg/i2cdevlib · GitHub ,download the mpu6050 library,there are two example,one of them is MPU6050_raw,do some modfication ,you can get the raw data correctly.

thank you for your help,

But how do you chose the sensivity?

Set to ±2000 (least sensitive), try it out, increase sensitivity till the signal range is what you want.

How do I set the sensivity? And I donk understand why 2000 is the least sensitive, it should be the most accurate