 SoftwareSerial mySerial = SoftwareSerial(255, lcdPin);
 SimpleTimer myTimer;
 int timerId, timerId2, timerId3;                          // reference to clock timer, light timer, and title timer
-String strTime, strLine2;
+String strTime;
 String strTitleDisplay = strTitle;
 String strGradDisplay = strGrad;
 boolean bTimerDone = false;

  }
}

// move the cursor to a specific place
// e.g.: cursorSet(3,2) sets the cursor to x = 3 and y = 2
void cursorSet(int xpos, int ypos){  
  Serial.write(254);
  Serial.write(71);               
  Serial.write(xpos);   //Column position   
  Serial.write(ypos); //Row position 
} 

void updateLCD() {
  if (bTimerDone) {
    if (scrollDirection == 0) {
      // scroll text right to left
      strGradDisplay = strGradDisplay.substring(1, strGradDisplay.length()) + strGradDisplay.charAt(0);
    } else if (scrollDirection == 1) {
      // scroll text left to right
      strGradDisplay = strGradDisplay.charAt(strGradDisplay.length() - 1) + strGradDisplay.substring(0, strGradDisplay.length() - 1);
    }
    
    mySerial.print(strGradDisplay);       // first line, display congrats
    mySerial.write(148);                  // new line
    
    int spaceCount = 16 - strTime.length() - 2;
    String strSpace = "";
    for (int i = 0; i < spaceCount; i++) {
      strSpace += " ";
    }     
    
    // format time in DD:HH:MM:SS
    strTime = formateClockTime(0, 0, 0, 0);
    
    // second line, display time and initials
    strLine2 = strTime + strSpace + "PK";
    mySerial.print(strLine2);
    Serial.println("Time: " + strTime);   // console debug
  } else {
    if (scrollDirection == 0) {
      // scroll text right to left
      strTitleDisplay = strTitleDisplay.substring(1, strTitleDisplay.length()) + strTitleDisplay.charAt(0);
    } else if (scrollDirection == 1) {
      // scroll text left to right
      strTitleDisplay = strTitleDisplay.charAt(strTitleDisplay.length() - 1) + strTitleDisplay.substring(0, strTitleDisplay.length() - 1);
    }
    
    mySerial.println(strTitleDisplay);
    int spaceCount = 16 - strTime.length() - 2;
    String strSpace = "";
    for (int i = 0; i < spaceCount; i++) {
      strSpace += " ";
    }
    
    // second line, display time and initials
    strLine2 = strTime + strSpace + "PK";
    mySerial.print(strLine2);
    Serial.println("Time: " + strTime);   // console debug
  }
}

// Get time left in DD:HH:MM:SS format.
String getClockTime(int daysLeft) {
  // calc seconds left
  double s = seconds;

  return s;
}

// Setup time to count.
void setupTime()
{
  seconds = (hMax * 60 * 60) + (mMax * 60) + sMax;   // seconds left
  days = 0;                                          // days elapsed 
}

// When the countdown finishes.
void onTimerEnd()
{
    // disable timers
    myTimer.disable(timerId2);
    mySerial.write(12);                   // clear
    bTimerDone = true;
    
    // display time of zero: 00:00:00:00
    strTime = formateClockTime(0, 0, 0, 0);
}

