     if (sim900.ensureReady() == true)
     {
       sim900.sendTextMsg(smsBuffer, PHONE_NUMBER);
-      if (sim900.isTextMsgDelivered() == false)
+      if (sim900.isTextMsgDelivered(SMS_TIMEOUT) == false)
       {
         sd.begin();
         sd.writeFile(UNSENT_FILENAME, smsBuffer);

} SensorReading;


// Global Variables
int sleepCount = 0;
int numCachedReadings = 0;
int totalReadings = 0;

#define NUM_DISTANCE_READINGS      3
#define DISTANCE_READING_DELAY     200
#define DISTANCE_INCREMENT         5
#define SMS_TIMEOUT                250
#define DATA_DELIM                 ';'
#define BACKUP_FILENAME            "backup.txt"
#define UNSENT_FILENAME            "unsent.txt"
