Thank you, I appreciate the assistance and advice.
Delta_G's method worked out perfectly (with some minor changes). This allowed me to finish up this portion of the project.
Econjack -- Speed is not really a concern for this. The purpose of this project is to turn on/off some outdoor lights via a connected relay. The complete code updates the time via NTP every hour, and pulls sunrise and sunset times from Weather Underground and updates accordingly. The scrolling text wasn't entirely necessary, but just something I thought would look cool once completed. The display currently shows the time on the first line and the date on the second line. The 3rd line scrolls text across the screen but scrolls through 4 different strings. The fourth line displays the time that the current text on the third line refers to. I use a switch statement with a counter to determine which text scrolls, and I broke down each 'set' of scrolling text into individual functions. Here is just one example:
void scrollSunset() {
curMillis = millis();
if (i < 20) {
if ((curMillis - prevMillis) >= 300) {
lcd.setCursor(19 - i , 2);
lcd.print(nss.substring(0, i + 1));
lcd.setCursor(((20 - astronomy.sunsetTime.length()) / 2), 3);
lcd.print(astronomy.sunsetTime);
prevMillis = curMillis;
i++;
}
}
else {
if ((curMillis - prevMillis) == 5000) {
i = 0;
prevMillis = curMillis;
lcd.setCursor(0, 2);
lcd.print(" ");
lcd.setCursor(0, 3);
lcd.print(" ");
x++;
}
}
}
I know there is almost always more than one way to do things, but I have my code working properly now using several 'if' statements. I knew that strings aren't very memory-friendly, but I wasn't aware that a char array would be that much smaller. That is definitely something I will look into.
I have one other quick question I'll ask here, rather than start a new thread: My complete code looks like it is going to be 500+ lines. Is there any problem moving functions onto a different tab?? For example, I currently have a second tab named 'setbyntp' and it contains only the functions used in order to update the time. I have another tab named 'wunderground' that contains the functions for the scrolling text and updates. The code compiles and runs perfectly. Is this OK, or should ALL of the code be on just one page?