fork https://os.mbed.com/users/onehorse/code/MPU9250AHRS/ buat mpu 9255

Dependencies:   mbed

Fork of MPU9250AHRS by Kris Winer

Revision:
3:bf624b3ae5b9
Parent:
2:4e59a37182df
--- a/MPU9250.h	Tue Aug 05 01:37:23 2014 +0000
+++ b/MPU9250.h	Wed Oct 24 12:37:42 2018 +0000
@@ -190,7 +190,7 @@
 float aRes, gRes, mRes;      // scale resolutions per LSB for the sensors
 
 //Set up I2C, (SDA,SCL)
-I2C i2c(I2C_SDA, I2C_SCL);
+I2C i2c(D14, D15);
 
 DigitalOut myled(LED1);
     
@@ -625,7 +625,7 @@
 // Configure the accelerometer for self-test
    writeByte(MPU9250_ADDRESS, ACCEL_CONFIG, 0xE0); // Enable self test on all three axes and set accelerometer range to +/- 2 g
    writeByte(MPU9250_ADDRESS, GYRO_CONFIG, 0xE0); // Enable self test on all three axes and set gyro range to +/- 250 degrees/s
-   delay(25); // Delay a while to let the device stabilize
+   wait(25); // Delay a while to let the device stabilize
 
   for( int ii = 0; ii < 200; ii++) { // get average self-test values of gyro and acclerometer
   
@@ -648,7 +648,7 @@
  // Configure the gyro and accelerometer for normal operation
    writeByte(MPU9250_ADDRESS, ACCEL_CONFIG, 0x00);
    writeByte(MPU9250_ADDRESS, GYRO_CONFIG, 0x00);
-   delay(25); // Delay a while to let the device stabilize
+   wait(25); // Delay a while to let the device stabilize
    
    // Retrieve accelerometer and gyro factory Self-Test Code from USR_Reg
    selfTest[0] = readByte(MPU9250_ADDRESS, SELF_TEST_X_ACCEL); // X-axis accel self-test results