  time loop() runs, so using delay inside loop can delay
  response.  Multiple bytes of data may be available.
  */
-void serialEvent() {
+void serialEvent()
+{
   while (Serial.available()) {
-    // get the new byte:
+    // Get the new byte:
     char inChar = (char)Serial.read(); 
+    // Add it to the inputString:
+    inputString += inChar;
+    // If the incoming character is a newline, set a flag
+    // so the main loop can do something about it:
+    if (inChar == '\n') {
+      stringComplete = true;
+    } 
   }
 }
+
 
 void loop()
 {   
-    
+    processSerialInput();
     if (fabs(millis()-last_baro_read_ms)>1./BaroRate)
     {
       last_baro_read_ms = millis();

      // produced by the on-board Digital Motion Processor of Invensense's MPU6050 6 DoF and MPU9150 9DoF sensors.
      // The 3.3 V 8 MHz Pro Mini is doing pretty well!
    }
}
void getBaroData()
{

  // join I2C bus (I2Cdev library doesn't do this automatically)
  Wire.begin();
  Serial.begin(57600); // Start serial at 57600 bps
  // Reserve bytes for the inputString:
  inputString.reserve(200);

  delay(2000);            

