   obd.println(obd_cmd);
   readOBD();
 }
+
+void checkIncommingCmd(int cmd)
+{
+  switch (cmd) {
+    case 0:
+      send_OBD_cmd(PID_RPM);
+      break;
+    case 1:
+      send_OBD_cmd(PID_SPEED);
+      break;
+    case 2:
+      send_OBD_cmd(PID_FUEL_LEVEL);
+      break;
+    case 3:
+      send_OBD_cmd(PID_DISTANCE);
+      break;
+    case 4:
+      send_OBD_cmd(PID_THROTTLE);
+      break;
+  }
+}

void loop()
{
  readGPS();
  
  send_OBD_cmd("ATZ");      //send to OBD ATZ, reset
  delay(1000);
  send_OBD_cmd("ATSP0");    //send ATSP0, protocol auto

    delay(1000); // wait 1 sec to give time enough for the serial to receive all the stream
    while (obd.available()) {
      msg += obd.read();
    }
    Serial.println(msg);
    delay(50);
  } else {
    sendMessage("No data from OBD2.");
  }
  obd.flush();
}
