test

Dependencies:   mbed

MPU9250 I2C通信 注意:プルアップ抵抗を入れるのを忘れないように

Revision:
1:71c319f03fda
Parent:
0:2e5e65a6fb30
Child:
3:e7be5e23013d
diff -r 2e5e65a6fb30 -r 71c319f03fda main.cpp
--- a/main.cpp	Sun Jun 29 22:02:30 2014 +0000
+++ b/main.cpp	Tue Aug 05 01:34:45 2014 +0000
@@ -86,6 +86,13 @@
     wait(1);
     
     mpu9250.resetMPU9250(); // Reset registers to default in preparation for device calibration
+    mpu9250.MPU9250SelfTest(SelfTest); // Start by performing self test and reporting values
+    pc.printf("x-axis self test: acceleration trim within : %f % of factory value\n\r", SelfTest[0]);  
+    pc.printf("y-axis self test: acceleration trim within : %f % of factory value\n\r", SelfTest[1]);  
+    pc.printf("z-axis self test: acceleration trim within : %f % of factory value\n\r", SelfTest[2]);  
+    pc.printf("x-axis self test: gyration trim within : %f % of factory value\n\r", SelfTest[3]);  
+    pc.printf("y-axis self test: gyration trim within : %f % of factory value\n\r", SelfTest[4]);  
+    pc.printf("z-axis self test: gyration trim within : %f % of factory value\n\r", SelfTest[5]);  
     mpu9250.calibrateMPU9250(gyroBias, accelBias); // Calibrate gyro and accelerometers, load biases in bias registers  
     pc.printf("x gyro bias = %f\n\r", gyroBias[0]);
     pc.printf("y gyro bias = %f\n\r", gyroBias[1]);