Mu kylong / Mbed 2 deprecated MPU9250_SPI_Test

Dependencies:   MPU9250_SPI mbed

Dependents:   MPU9250_SPI_Test_1201

Files at this revision

API Documentation at this revision

Comitter:
kylongmu
Date:
Tue Jul 01 14:16:04 2014 +0000
Parent:
4:6bfddd447c27
Commit message:
Add calibration magnetometer function.

Changed in this revision

MPU9250.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MPU9250.lib	Mon Jun 30 13:16:13 2014 +0000
+++ b/MPU9250.lib	Tue Jul 01 14:16:04 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/kylongmu/code/MPU9250_SPI/#492028cb604e
+http://mbed.org/users/kylongmu/code/MPU9250_SPI/#084e8ba240c1
--- a/main.cpp	Mon Jun 30 13:16:13 2014 +0000
+++ b/main.cpp	Tue Jul 01 14:16:04 2014 +0000
@@ -10,7 +10,7 @@
 mpu9250_spi imu(spi,SPI_CS);   //define the mpu9250 object
 int main(){
     pc.baud(115200);
-    if(imu.init(1,BITS_DLPF_CFG_5HZ)){  //INIT the mpu9250
+    if(imu.init(1,BITS_DLPF_CFG_188HZ)){  //INIT the mpu9250
         printf("\nCouldn't initialize MPU9250 via SPI!");
     }    
     printf("\nWHOAMI=0x%2x\n",imu.whoami()); //output the I2C address to know if SPI is working, it should be 104
@@ -21,6 +21,7 @@
     wait(1);
     printf("AK8963 WHIAM=0x%2x\n",imu.AK8963_whoami());
     wait(0.1);  
+    imu.AK8963_calib_Magnetometer();
     while(1) {
         //myled = 1;
         wait(0.1);
@@ -45,7 +46,6 @@
             );
         //myled = 0;
         //wait(0.5);
- 
     }
 }
  
\ No newline at end of file