You have messed up the last code that you posted by ending the loop() function too early,
Here it is Auto Formatted
unsigned long startMillis;
unsigned long currentMillis;
const unsigned long ScreenRefresh = 5000;
void loop()
{
currentMillis = millis();
if (customKey == '*' )
{
currentMillis = millis();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("The Coop Door Is");
ScreenTwo = HIGH;
}
}
if (ScreenTwo == HIGH) //if we are showing screen 2
{
if (currentMillis - startMillis >= ScreenRefresh) //if the period has passed
{
CoopDoor(); //refresh the screen
startMillis = currentMillis; //save the time that it was refreshed
ClearScreen();
}
}
}
void ClearScreen ()
{
ScreenTwo = LOW;
lcd.clear();
MainMenu();
and it ends without a }
A couple of other things
1 - you only need to update currentMillis once. Usually it is convenient to do this at the start of loop()
2 personally I would use a boolean for the ScreenTwo variable as the code reads better, at least to me
if (ScreenTwo == true) //if we are showing screen 2