College Project
Dependencies: mbed MPU9250_SPI_Test MPU9250-XCLIN
Diff: main.cpp
- Revision:
- 5:5839d1b118bc
- Parent:
- 4:6bfddd447c27
- Child:
- 6:cc0a54642cdb
--- 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