Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MPU9250_SPI mbed
Dependents: MPU9250_SPI_Test_1201
Revision 5:5839d1b118bc, committed 2014-07-01
- 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