String mainMenu[menuSize] = {
"Time", "Date", "Temp", "Humidity", "Light1", "Light2", "Pump1", "Pump2", "Fan1", "Fan2", "Fan3", "Fan4"};
String timeMenu[four] = {
"Set Time", "Hour:", "Minute:", "home"};
String timeHourMenu[four] = {
"Set Hour","Hour:", "home"};
String timeMinuteMenu[four] = {
"Set Minute", "Minute: ", "home"};
String dateMenu[five] = {
"Set Date", "Month:", "Day:", "Year:", "home"};
String dateMonthMenu[four] = {
"Set Month", "Month:", "home"};
String dateDayMenu[four] = {
"Set Day", "Day:", "home"};
String dateYearMenu[four] = {
"Set Year", "Year:", "home"};
String tempMenu[two] = {
"Temperature:", "home",};
String humiMenu[two] = {
"Humidity:", "home"};
String light1Menu[five] = {
"Light1 Menu", " ON:", " OFF:", "CONTINUOUS", "home"};
String light1OnMenu[three] = {
"Set Light1 On", "ON:", "home"};
String light1OffMenu[three] = {
"Set Light1 Off", "OFF:", "home"};
String light2Menu[five] = {
"Light2 Menu", " ON:", " OFF:", "CONTINUOUS", "home"};
String light2OnMenu[three] = {
"Set Light2 On", "ON:", "home"};
String light2OffMenu[three] = {
"Set Light2 Off", "OFF:", "home"};
String pump1Menu[three] = {
"Pump1 Menu","Soil Moisture:","home"};
String pump2Menu[three] = {
"Pump2 Menu","Soil Moisture:","home"};
String fan1Menu[five] = {
"Fan1 Menu", " ON:", " OFF:", "CONTINUOUS", "home"};
String fan2Menu[five] = {
"Fan2 Menu", " ON:", " OFF:", "CONTINUOUS", "home"};
String fan3Menu[five] = {
"Fan3 Menu", " ON:", " OFF:", "CONTINUOUS", "home"};
String fan4Menu[five] = {
"Fan4 Menu", " ON:", " OFF:", "CONTINUOUS", "home"};
String fan1OnMenu[three] = {
"Set Fan1 On", "ON:", "home"};
String fan2OnMenu[three] = {
"Set Fan2 On", "ON:", "home"};
String fan3OnMenu[three] = {
"Set Fan3 On", "ON:", "home"};
String fan4OnMenu[three] = {
"Set Fan4 On", "ON:", "home"};
String fan1OffMenu[three] = {
"Set Fan1 Off", "OFF:", "home"};
String fan2OffMenu[three] = {
"Set Fan2 Off", "OFF:", "home"};
String fan3OffMenu[three] = {
"Set Fan3 Off", "OFF:", "home"};
String fan4OffMenu[three] = {
"Set Fan4 Off", "OFF:", "home"};
Not a single one of these needs to be a String. Use strings char *), instead.
pinMode(soil1Pin, INPUT);
pinMode(soil2Pin, INPUT);
You can't set the mode of an analog pin, so quit trying. They are input only.
mainMenu[0] = String(hour()) + ":" + String(minute()) + ":" + String(second());
mainMenu[1] = String(month()) + "/" + String(day()) + "/" + String(year());
mainMenu[2] = "Temp: " + String(far(temp)) + " F";
mainMenu[3] = "Humidity: " + String(h) + "%";
Why are you overwriting mainMenu?
You really need to learn how to use strings, and quit pissing resources away on Strings. You have a finite number of rows and a finite number of columns on the LCD. Create a 21 x 4 array of chars, and use that to define what to display on the LCD.