Kalibrasi AVRG

Dependencies:   mbed

Revision:
4:cd99bf0e7502
Parent:
3:bf624b3ae5b9
Child:
5:dbb770470110
Child:
6:b970c0e20295
diff -r bf624b3ae5b9 -r cd99bf0e7502 main.cpp
--- a/main.cpp	Wed Oct 24 12:37:42 2018 +0000
+++ b/main.cpp	Wed Oct 24 13:05:04 2018 +0000
@@ -55,6 +55,7 @@
     if (whoami == 0x73) { // WHO_AM_I should always be 0x68
         pc.printf("MPU9250 WHO_AM_I is 0x%x\n\r", whoami);
         pc.printf("MPU9250 is online...\n\r");
+        /*
 //        lcd.clear();
 //        lcd.printString("MPU9250 is", 0, 0);
         sprintf(buffer, "0x%x", whoami);
@@ -78,6 +79,7 @@
         pc.printf("y accel bias = %f\n\r", accelBias[1]);
         pc.printf("z accel bias = %f\n\r", accelBias[2]);
         wait(2);
+        */
         mpu9250.initMPU9250();
         pc.printf("MPU9250 initialized for active data mode....\n\r"); // Initialize device for active mode read of acclerometer, gyroscope, and temperature
         mpu9250.initAK8963(magCalibration);
@@ -151,8 +153,8 @@
 
         // Serial print and/or display at 2 s rate independent of data rates
         delt_t = t.read_ms() - count;
-        if (delt_t > 2000) { // update LCD once per half-second independent of read rate
-
+        if (delt_t > 1000) { // update LCD once per half-second independent of read rate
+/*
             pc.printf("ax = %f", 1000*ax);
             pc.printf(" ay = %f", 1000*ay);
             pc.printf(" az = %f  mg\n\r", 1000*az);
@@ -160,11 +162,11 @@
             pc.printf("gx = %f", gx);
             pc.printf(" gy = %f", gy);
             pc.printf(" gz = %f  deg/s\n\r", gz);
-
-            pc.printf("gx = %f", mx);
-            pc.printf(" gy = %f", my);
-            pc.printf(" gz = %f  mG\n\r", mz);
-
+*/
+            pc.printf("mx = %f", mx);
+            pc.printf(" my = %f", my);
+            pc.printf(" mz = %f  mG\n\r", mz);
+/*
             tempCount = mpu9250.readTempData();  // Read the adc values
             temperature = ((float) tempCount) / 333.87f + 21.0f; // Temperature in degrees Centigrade
             pc.printf(" temperature = %f  C\n\r", temperature);
@@ -173,7 +175,7 @@
             pc.printf("q1 = %f\n\r", q[1]);
             pc.printf("q2 = %f\n\r", q[2]);
             pc.printf("q3 = %f\n\r", q[3]);
-
+*/
             /*    lcd.clear();
                 lcd.printString("MPU9250", 0, 0);
                 lcd.printString("x   y   z", 0, 1);