     mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
     mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);
 
-    if (Serial.available()) {
-      command = Serial.read();
-      switch (command) {
-        case 'i':
-          Serial.println("i\ttrue");
-          break;
-        case 'g':
-          Serial.print("g\t");
-          Serial.print(ypr[0] * 180 / M_PI);
-          Serial.print("\t");
-          Serial.print(ypr[1] * 180 / M_PI);
-          Serial.print("\t");
-          Serial.println(ypr[2] * 180 / M_PI);
-          break;
-        case 'a':
-          Serial.print("a\t");
-          Serial.print(aaWorld.x);
-          Serial.print("\t");
-          Serial.print(aaWorld.y);
-          Serial.print("\t");
-          Serial.println(aaWorld.z);
-          break;
-        default:
-          Serial.print("ERROR - Command ");
-          Serial.print(command);
-          Serial.println(" unknown!");
-      }
-
-      // blink LED to indicate activity
-      blinkState = !blinkState;
-      digitalWrite(LED_PIN, blinkState);
-    }
+    // blink LED to indicate activity
+    blinkState = !blinkState;
+    digitalWrite(LED_PIN, blinkState);
   }
+
+  sendData();
 }

#endif

  // initialize serial communication
  // (115200 chosen because it is required for Teapot Demo output, but it's
  // really up to you depending on your project)
  Serial.begin(115200);
  while (!Serial); // wait for Leonardo enumeration, others continue immediately

  // NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio
  // Pro Mini running at 3.3v, cannot handle this baud rate reliably due to
  // the baud timing being too misaligned with processor ticks. You must use
  // 38400 or slower in these cases, or use some kind of external separate
  // crystal solution for the UART timer.

  // initialize device
  Serial.println(F("Initializing I2C devices..."));

  // load and configure the DMP
  Serial.println(F("Initializing DMP..."));
  devStatus = mpu.dmpInitialize();

  // make sure it worked (returns 0 if so)
  if (devStatus == 0) {
