   noTone(8);
   delay(100);
 }*/
-

// Functions
void setReference();
void GPSData();
//void ring();
/*******************************************************************************************
Function Name: Setup
*******************************************************************************************/
void setup() {
  Serial1.begin(9600); // initialize serial communication for BT
  GPS.begin(9600); // initialize serial communication for GPS
  //GSMmodule.begin(9600); // initialize serial communication for GSM
  
  // initialize device
  Serial1.println("Initializing IMU device...");
  CurieIMU.begin();

  // Set the accelerometer range to 3G
  CurieIMU.setAccelerometerRange(3);
  delay(1000);
}
/*******************************************************************************************
Function Name: Loop
*******************************************************************************************/
void loop() {
  //ring();
  if (Serial1.available() > 0) {
    char ch = Serial1.read();

Function Name: GPSData
*******************************************************************************************/
void GPSData() {
  //while (!finish) {
  //Serial1.println(GPS.available());
    while (GPS.available() > 0) {       // Check GPS data
      Gpsdata = GPS.read();
      //Serial1.write(Gpsdata);
