I'm trying to display two different lines of text in this function on the second line of an 16x2 LCD with 3 second intervals. The first line of "Clear the track" should display for 3 seconds then the second line of "and press button" for another three seconds. It should then go back to "Clear the track" and start over. My sketch compiles and uploads fine, but I only ever see the "and press button" on the second line. I never see "Clear the track". Where did I go wrong with my logic?
void callibrate_scale() {
lcd.clear();
secondLine = false;
Serial.println("Callibrating... Clear the track and press button.");
startTime = millis();
while (digitalRead(TareCalButton) == HIGH) {
lcd.setCursor(0,0);
lcd.print("Callibrating... ");
if ((millis() <= startTime + 3000) && (secondLine = false)) {
lcd.setCursor(0,1);
lcd.print("Clear the track ");
}
else if ((millis() > startTime + 3000) && (secondLine = false)) {
secondLine = true;
startTime = millis();
}
if ((millis() <= startTime + 3000) && (secondLine = true)) {
lcd.setCursor(0,1);
lcd.print("and press button");
}
else if ((millis() > startTime + 3000) && (secondLine = true)) {
secondLine = false;
startTime = millis();
}
}
}