   delay(50);
 }
 /*******************************************************************************************
+Function Name: command_match
+*******************************************************************************************/
+void command_match(void)
+{
+  if (strcmp(message, "1") == 0)
+  {
+    send_message();
+    delay(50);
+  }
+  /*else if ((strcmp(message, "off") == 0) || (strcmp(message, "OFF") == 0))
+  {
+    digitalWrite(light, LOW);
+    Serial.println("Turning LED off");
+    delay(50);  
+  }*/
+}
+/*******************************************************************************************
 Function Name: setReference
 *******************************************************************************************/
 void setReference() {

// 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();

char lt[20];            // latitude array
char lg[20];             // longitude array

char m_num_my[] = {"+918871408244"}; // Enter your number here
char Rec_Data = 0;
int msg_flg = 0;
byte msg_flag_2 = 0;
byte call_flag = 0;
byte reply_flag = 0;
byte delete_flag = 0;
byte d_count = 0;
byte i = 0;
byte j = 0;
char number[15];
char message[160];

int avgX = 0;
int avgY = 0;
int avgZ = 0;
