MPU9250 SPI Driver

Revision:
9:a8733542d0fb
Parent:
8:492028cb604e
Child:
10:d27b3298e9e0
--- a/MPU9250.cpp	Mon Jun 30 13:15:53 2014 +0000
+++ b/MPU9250.cpp	Tue Jul 01 10:58:36 2014 +0000
@@ -55,10 +55,10 @@
         {0x80, MPUREG_PWR_MGMT_1},     // Reset Device
         {0x01, MPUREG_PWR_MGMT_1},     // Clock Source
         {0x00, MPUREG_PWR_MGMT_2},     // Enable Acc & Gyro
-        {0x07, MPUREG_CONFIG},         //
+        {0x01, MPUREG_CONFIG},         // Use DLPF set Gyroscope bandwidth 184Hz, temperature bandwidth 188Hz
         {0x18, MPUREG_GYRO_CONFIG},    // +-2000dps
         {0x08, MPUREG_ACCEL_CONFIG},   // +-4G
-        {0x00, MPUREG_ACCEL_CONFIG_2}, // Set Acc Data Rates
+        {0x09, MPUREG_ACCEL_CONFIG_2}, // Set Acc Data Rates, Enable Acc LPF , Bandwidth 184Hz
         {0x30, MPUREG_INT_PIN_CFG},    //
         //{0x40, MPUREG_I2C_MST_CTRL},   // I2C Speed 348 kHz
         //{0x20, MPUREG_USER_CTRL},      // Enable AUX
@@ -342,7 +342,7 @@
     //Get temperature
     bit_data=((int16_t)response[i*2]<<8)|response[i*2+1];
     data=(float)bit_data;
-    Temperature=(data/340)+36.53;
+    Temperature=((data-21)/333.87)+21;
     //Get gyroscop value
     for(i=4; i<7; i++) {
         bit_data=((int16_t)response[i*2]<<8)|response[i*2+1];