   return datastring;
 }
 
+// get time in short format
 String getShortTimeString ()
 {
   String shtime;


void setup()
{
  Serial.begin(9600);
  Wire.begin();
  SIM900.begin(57600);
  sensors.begin();

  startOfPeriod1 = now();
  startOfPeriod2 = now();
  startOfPeriod3 = now();
  call_done = false;
  armed = true;


  delay(1000);
  SIM900.println("AT");
  delay(1000);
  SIM900.println("ATH");
  delay(1000);

  return true;
}

// proceed a sending message to number
boolean sendSMS(String number, String message)
{
  SIM900.print("AT+CMGF=1\r");                              // AT command to send SMS message
  delay(100);
  SIM900.print("AT + CMGS = \"");
  SIM900.print(number);
  Serial.println(number);
  SIM900.println("\"");                                     // recipient's mobile number, in international format
  delay(100);
  SIM900.println(message);                                  // message to send
  Serial.println(message);
  delay(100);
  SIM900.println((char)26);                                 // End AT command with a ^Z, ASCII code 26
  delay(100);
  SIM900.println();
  delay(30000);                                             // give module time to send SMS
  return true;
}

// main loop
void loop()
{

