Adding ds1307 rtc time to LiquidLine?

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;

// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
	increase = 1,
	decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;


// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, timeClock);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine offON(9, 0, onOFF);
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line, offON);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
 * LiquidSystem object combines the LiquidMenu objects to form
 * a menu system. It provides the same functions as LiquidMenu
 * with the addition of add_menu() and change_menu().
 */
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
	if (right.check() == LOW) {
		menu_system.next_screen();
	}
	if (left.check() == LOW) {
		menu_system.previous_screen();
	}
	if (up.check() == LOW) {
		menu_system.call_function(increase);
	}
	if (down.check() == LOW) {
		menu_system.call_function(decrease);
	}
	if (enter.check() == LOW) {
		menu_system.switch_focus();
	}
}

// Callback function that will be attached to back_line.
void go_back() {
	// This function takes reference to the wanted menu.
	menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
	menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
	menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
	if (pin6_level < 225) {
		pin6_level += 25;
	}
	else {
		pin6_level = 250;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void decrease_pin6() {
	if (pin6_level > 25) {
		pin6_level -= 25;
	}
	else {
		pin6_level = 0;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void save_input() {
	EEPROM.put(11, sample_period);
	input_saved = (char*)" *";
}

void save_output() {
	EEPROM.put(9, pin6_level);
	output_saved = (char*)" *";
}

void increase_samplePeriod() {
	if (sample_period < 10) {
		sample_period++;
		input_saved = (char*)"  ";
	}
}

void decrease_samplePeriod() {
	if (sample_period > 0) {
		sample_period--;
		input_saved = (char*)"  ";
	}
}
void relayState(char* onOFF) {
	for (int x; x < 8; x++) {
		if (digitalRead(x) == HIGH) {
			onOFF = (char *)"ON";
		}
		else {
			onOFF = (char*)"OFF";
		}
	}
}
int timeClock() {
	DateTime now = rtc.now();
	if (!rtc.begin()) {
		Serial.println("Couldn't find RTC");
		while (1);
	}
	if (!rtc.isrunning()) {
		Serial.println("RTC lost power, lets set the time!");
		// Comment out below lines once you set the date & time.
		  // Following line sets the RTC to the date & time this sketch was compiled
		rtc.adjust(DateTime(__DATE__, __TIME__));
	}
}

void setup() {
	Serial.begin(250000);

	pinMode(pin6, OUTPUT);

	// Reads the values recorded in the EEPROM
	EEPROM.get(9, pin6_level);
	EEPROM.get(11, sample_period);
	analogWrite(pin6, pin6_level);

	lcd.init();
	lcd.backlight();

	back_line.set_focusPosition(Position::LEFT);

	back_line.attach_function(1, go_back);
	back_line.attach_function(2, go_back);

	outputs_line.attach_function(1, goto_outputs_menu);
	outputs_line.attach_function(2, goto_outputs_menu);
	inputs_line.attach_function(1, goto_inputs_menu);
	inputs_line.attach_function(2, goto_inputs_menu);

	pin6_line.attach_function(increase, increase_pin6);
	pin6_line.attach_function(decrease, decrease_pin6);

	oSave_line.attach_function(1, save_output);
	oSave_line.attach_function(2, save_output);
	iSave_line.attach_function(1, save_input);
	iSave_line.attach_function(2, save_input);
	iSample_line.attach_function(increase, increase_samplePeriod);
	iSample_line.attach_function(decrease, decrease_samplePeriod);

	input_saved = (char*)" *";
	output_saved = (char*)" *";
	//relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
	//onOFF = (char *)"ON";

	menu_system.update();
}

void loop() {
	buttonsCheck();
	relayState(onOFF);
	static unsigned long lastMillis_sample = 0;
	if (millis() - lastMillis_sample > (sample_period * 1000)) {
		lastMillis_sample = millis();
		menu_system.update();
	}
}

Unfortunately I am a little burn out on this today, trying to display a ds1307 rtc on welcome_line3
but won’t compile due to saying timeClock is not defined in the scope, I can’t seem to figure out the type to write it correctly so it can be defined. Kind of really hoping someone else has a good idea of being able to display the time on liquidline.

Format the time into a c-string buffer and display it.

gfvalvo:
Format the time into a c-string buffer and display it.

Thats to advance for me at the moment, I need someone who can show me the example used at the moment, I did google string buffers, just seems a little advance for me right now.

The .ino files of Arduino sketches are compiled as standard C++ after some minor preprocessing. One of the preprocessing steps is generating function prototypes for any functions in your .ino files that don't already have a function prototype. In C++, you must declare a function before the first time it is referenced in the code. One way to do that would be to move the function definition before the first reference. However, you might want to have more flexibility in how you organize your code. This is where function prototypes are useful. They tell the compiler what the signature of the function will be, which is all it needs to know at that point in the compilation process.

Since manually adding function prototypes adds an extra source of potential confusion for beginners and is tedious for everyone, Arduino added an automatic function prototype generation feature to the Arduino IDE. So if you don't add function prototypes yourself to your .ino files, the IDE does it for you. The tricky thing is that the function prototype needs to be added at just the right location in the sketch.

The IDE gets this right almost all the time, but there are some corner cases where it screws it up. That's the source of the error you are having. You are referencing the timeClock function here:

keyboardcowboy:

LiquidLine welcome_line3(1, 2, timeClock);

but the IDE is adding the function prototype for timeClock somewhere after that line. The solution is to manually add the function prototype for timeClock in the right place. This is what the function prototype looks like:

int timeClock();

So just add that somewhere above this line:

LiquidLine welcome_line3(1, 2, timeClock);

You may need to do the same for some of your other functions.

Function prototype generation failures can lead to very confusing errors. Sometimes the error messages don't even match the code in your sketch, since the error line is the "hidden" code inserted by the Arduino IDE. When you encounter such an error, it can be very helpful to examine the post-sketch preprocessing output:

  • File > Preferences
  • Check the box next to "Show verbose output during: compilation'
  • Click "OK"
  • Sketch > Verify/Compile
  • After compilation fails, scroll the black console window at the bottom of the Arduino IDE window all the way to the top.
  • Examine the first line of output to find the value of the "-build-path" option.

For example, if you had this:

C:\ArduinoIDE\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware C:\ArduinoIDE\arduino-nightly\hardware -hardware C:\Users\per\AppData\Local\Arduino15\packages -hardware E:\electronics\arduino\hardware -tools C:\ArduinoIDE\arduino-nightly\tools-builder -tools C:\ArduinoIDE\arduino-nightly\hardware\tools\avr -tools C:\Users\per\AppData\Local\Arduino15\packages -built-in-libraries C:\ArduinoIDE\arduino-nightly\libraries -libraries E:\electronics\arduino\libraries -fqbn=esp32:esp32:node32s:FlashFreq=80,UploadSpeed=921600 -vid-pid=0X2341_0X0042 -ide-version=10809 -build-path C:\Users\per\AppData\Local\Temp\arduino_build_889992 -warnings=all -build-cache C:\Users\per\AppData\Local\Temp\arduino_cache_764477 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.esptool.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\esptool\2.3.1 -prefs=runtime.tools.esptool-2.3.1.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\esptool\2.3.1 -prefs=runtime.tools.mkspiffs.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -verbose C:\Users\per\AppData\Local\Temp\arduino_modified_sketch_19197\sketch_dec31a.ino

the temporary build folder is C:\Users\per\AppData\Local\Temp\arduino_build_889992.

Open the .ino.cpp file in the sketch subfolder of the temporary build folder with a text editor.

The temporary build folder will be deleted when you exit the Arduino IDE.

pert:
The .ino files of Arduino sketches are compiled as standard C++ after some minor preprocessing. One of the preprocessing steps is generating function prototypes for any functions in your .ino files that don't already have a function prototype. In C++, you must declare a function before the first time it is referenced in the code. One way to do that would be to move the function definition before the first reference. However, you might want to have more flexibility in how you organize your code. This is where function prototypes are useful. They tell the compiler what the signature of the function will be, which is all it needs to know at that point in the compilation process.

Since manually adding function prototypes adds an extra source of potential confusion for beginners and is tedious for everyone, Arduino added an automatic function prototype generation feature to the Arduino IDE. So if you don't add function prototypes yourself to your .ino files, the IDE does it for you. The tricky thing is that the function prototype needs to be added at just the right location in the sketch.

The IDE gets this right almost all the time, but there are some corner cases where it screws it up. That's the source of the error you are having. You are referencing the timeClock function here:but the IDE is adding the function prototype for timeClock somewhere after that line. The solution is to manually add the function prototype for timeClock in the right place. This is what the function prototype looks like:

int timeClock();

So just add that somewhere above this line:

LiquidLine welcome_line3(1, 2, timeClock);

You may need to do the same for some of your other functions.

Function prototype generation failures can lead to very confusing errors. Sometimes the error messages don't even match the code in your sketch, since the error line is the "hidden" code inserted by the Arduino IDE. When you encounter such an error, it can be very helpful to examine the post-sketch preprocessing output:

  • File > Preferences
  • Check the box next to "Show verbose output during: compilation'
  • Click "OK"
  • Sketch > Verify/Compile
  • After compilation fails, scroll the black console window at the bottom of the Arduino IDE window all the way to the top.
  • Examine the first line of output to find the value of the "-build-path" option.

For example, if you had this:

C:\ArduinoIDE\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware C:\ArduinoIDE\arduino-nightly\hardware -hardware C:\Users\per\AppData\Local\Arduino15\packages -hardware E:\electronics\arduino\hardware -tools C:\ArduinoIDE\arduino-nightly\tools-builder -tools C:\ArduinoIDE\arduino-nightly\hardware\tools\avr -tools C:\Users\per\AppData\Local\Arduino15\packages -built-in-libraries C:\ArduinoIDE\arduino-nightly\libraries -libraries E:\electronics\arduino\libraries -fqbn=esp32:esp32:node32s:FlashFreq=80,UploadSpeed=921600 -vid-pid=0X2341_0X0042 -ide-version=10809 -build-path C:\Users\per\AppData\Local\Temp\arduino_build_889992 -warnings=all -build-cache C:\Users\per\AppData\Local\Temp\arduino_cache_764477 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.esptool.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\esptool\2.3.1 -prefs=runtime.tools.esptool-2.3.1.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\esptool\2.3.1 -prefs=runtime.tools.mkspiffs.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=C:\Users\per\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -verbose C:\Users\per\AppData\Local\Temp\arduino_modified_sketch_19197\sketch_dec31a.ino

the temporary build folder is C:\Users\per\AppData\Local\Temp\arduino_build_889992.

Open the .ino.cpp file in the sketch subfolder of the temporary build folder with a text editor.

The temporary build folder will be deleted when you exit the Arduino IDE.

Thank you so much for being so informative!
I do consider myself a beginner I have on and off played with programming for over 10yrs, but just never spent enough time straight through any project to learn a good amount till now. That's the beauty in this to me, this allows users to learn through interacting with sensors and real life objects. I was thinking about moving timeClock above its call and might be a solution but was just a little burnt out after finally getting the state of a sensor printed next to outputs to see if any pins are on or off so as to not enter the menu to view that info.

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
DateTime now = rtc.now();
static String timm = rtc.now();
//static int timeClock = now;

// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
	increase = 1,
	decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, timm);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine offON(9, 0, onOFF);
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line, offON);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
 * LiquidSystem object combines the LiquidMenu objects to form
 * a menu system. It provides the same functions as LiquidMenu
 * with the addition of add_menu() and change_menu().
 */
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
	if (right.check() == LOW) {
		menu_system.next_screen();
	}
	if (left.check() == LOW) {
		menu_system.previous_screen();
	}
	if (up.check() == LOW) {
		menu_system.call_function(increase);
	}
	if (down.check() == LOW) {
		menu_system.call_function(decrease);
	}
	if (enter.check() == LOW) {
		menu_system.switch_focus();
	}
}

// Callback function that will be attached to back_line.
void go_back() {
	// This function takes reference to the wanted menu.
	menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
	menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
	menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
	if (pin6_level < 225) {
		pin6_level += 25;
	}
	else {
		pin6_level = 250;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void decrease_pin6() {
	if (pin6_level > 25) {
		pin6_level -= 25;
	}
	else {
		pin6_level = 0;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void save_input() {
	EEPROM.put(11, sample_period);
	input_saved = (char*)" *";
}

void save_output() {
	EEPROM.put(9, pin6_level);
	output_saved = (char*)" *";
}

void increase_samplePeriod() {
	if (sample_period < 10) {
		sample_period++;
		input_saved = (char*)"  ";
	}
}

void decrease_samplePeriod() {
	if (sample_period > 0) {
		sample_period--;
		input_saved = (char*)"  ";
	}
}
void relayState(char* onOFF) {
	for (int x; x < 8; x++) {
		if (digitalRead(x) == HIGH) {
			onOFF = (char *)"ON";
		}
		else {
			onOFF = (char*)"OFF";
		}
	}
}


void setup() {
	Serial.begin(250000);

	pinMode(pin6, OUTPUT);

	// Reads the values recorded in the EEPROM
	EEPROM.get(9, pin6_level);
	EEPROM.get(11, sample_period);
	analogWrite(pin6, pin6_level);


	lcd.init();
	lcd.backlight();

	back_line.set_focusPosition(Position::LEFT);

	back_line.attach_function(1, go_back);
	back_line.attach_function(2, go_back);

	outputs_line.attach_function(1, goto_outputs_menu);
	outputs_line.attach_function(2, goto_outputs_menu);
	inputs_line.attach_function(1, goto_inputs_menu);
	inputs_line.attach_function(2, goto_inputs_menu);

	pin6_line.attach_function(increase, increase_pin6);
	pin6_line.attach_function(decrease, decrease_pin6);

	oSave_line.attach_function(1, save_output);
	oSave_line.attach_function(2, save_output);
	iSave_line.attach_function(1, save_input);
	iSave_line.attach_function(2, save_input);
	iSample_line.attach_function(increase, increase_samplePeriod);
	iSample_line.attach_function(decrease, decrease_samplePeriod);

	input_saved = (char*)" *";
	output_saved = (char*)" *";
	//relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
	//onOFF = (char *)"ON";

	menu_system.update();
 DateTime now = rtc.now();
 if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
  // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop() {
	buttonsCheck();
	relayState(onOFF);
	static unsigned long lastMillis_sample = 0;
	if (millis() - lastMillis_sample > (sample_period * 1000)) {
		lastMillis_sample = millis();
		menu_system.update();
	}
}
Sep8LiqFinalExp:10:29: error: conversion from 'DateTime' to non-scalar type 'String' requested

 static String timm = rtc.now();

I tried char, char*, and int. All won’t convert, really am lost at the moment.

I think these 2 posts may be related to what I need possibly, but not sure yet. The solved thread
looked like it may contain a solution.

void fetchTime()
{
  DateTime now;

  // fetch the time
  now = RTC.now();

  char buffer [25] = "";
 
  sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
  dateTime = buffer;
  //Serial.print(buffer);
}

Does anyone agree with this solution, or is there another way of figuring this out?

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
void fetchTime() {
	char* dateTime;
	DateTime now;
	now = rtc.now();
	char buffer[25] = "";
	sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
	dateTime = buffer;
}
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
	increase = 1,
	decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, fetchTime);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine offON(9, 0, onOFF);
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line, offON);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
 * LiquidSystem object combines the LiquidMenu objects to form
 * a menu system. It provides the same functions as LiquidMenu
 * with the addition of add_menu() and change_menu().
 */
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
	if (right.check() == LOW) {
		menu_system.next_screen();
	}
	if (left.check() == LOW) {
		menu_system.previous_screen();
	}
	if (up.check() == LOW) {
		menu_system.call_function(increase);
	}
	if (down.check() == LOW) {
		menu_system.call_function(decrease);
	}
	if (enter.check() == LOW) {
		menu_system.switch_focus();
	}
}

// Callback function that will be attached to back_line.
void go_back() {
	// This function takes reference to the wanted menu.
	menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
	menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
	menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
	if (pin6_level < 225) {
		pin6_level += 25;
	}
	else {
		pin6_level = 250;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void decrease_pin6() {
	if (pin6_level > 25) {
		pin6_level -= 25;
	}
	else {
		pin6_level = 0;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void save_input() {
	EEPROM.put(11, sample_period);
	input_saved = (char*)" *";
}

void save_output() {
	EEPROM.put(9, pin6_level);
	output_saved = (char*)" *";
}

void increase_samplePeriod() {
	if (sample_period < 10) {
		sample_period++;
		input_saved = (char*)"  ";
	}
}

void decrease_samplePeriod() {
	if (sample_period > 0) {
		sample_period--;
		input_saved = (char*)"  ";
	}
}
void relayState(char* onOFF) {
	for (int x; x < 8; x++) {
		if (digitalRead(x) == HIGH) {
			onOFF = (char *)"ON";
		}
		else {
			onOFF = (char*)"OFF";
		}
	}
}


void setup() {
	Serial.begin(250000);

	pinMode(pin6, OUTPUT);

	// Reads the values recorded in the EEPROM
	EEPROM.get(9, pin6_level);
	EEPROM.get(11, sample_period);
	analogWrite(pin6, pin6_level);


	lcd.init();
	lcd.backlight();

	back_line.set_focusPosition(Position::LEFT);

	back_line.attach_function(1, go_back);
	back_line.attach_function(2, go_back);

	outputs_line.attach_function(1, goto_outputs_menu);
	outputs_line.attach_function(2, goto_outputs_menu);
	inputs_line.attach_function(1, goto_inputs_menu);
	inputs_line.attach_function(2, goto_inputs_menu);

	pin6_line.attach_function(increase, increase_pin6);
	pin6_line.attach_function(decrease, decrease_pin6);

	oSave_line.attach_function(1, save_output);
	oSave_line.attach_function(2, save_output);
	iSave_line.attach_function(1, save_input);
	iSave_line.attach_function(2, save_input);
	iSample_line.attach_function(increase, increase_samplePeriod);
	iSample_line.attach_function(decrease, decrease_samplePeriod);

	input_saved = (char*)" *";
	output_saved = (char*)" *";
	//relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
	//onOFF = (char *)"ON";

	menu_system.update();
 DateTime now = rtc.now();
 if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
  // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop() {
	buttonsCheck();
	relayState(onOFF);
	static unsigned long lastMillis_sample = 0;
	if (millis() - lastMillis_sample > (sample_period * 1000)) {
		lastMillis_sample = millis();
		menu_system.update();
	}
}
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\main.cpp: In function 'main':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:180:18: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]

   if (digitalRead(x) == HIGH) {

                  ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:179:11: note: 'x' was declared here

  for (int x; x < 8; x++) {

           ^

C:\Users\Bob\AppData\Local\Temp\ccAIQvqB.ltrans0.ltrans.o: In function `fetchTime()':

<artificial>:(.text+0x34c): undefined reference to `DateTime::DateTime(unsigned long)'

<artificial>:(.text+0x358): undefined reference to `RTC_DS1307::now()'

C:\Users\Bob\AppData\Local\Temp\ccAIQvqB.ltrans1.ltrans.o: In function `main':

<artificial>:(.text.startup+0x3ae): undefined reference to `RTC_DS1307::now()'

<artificial>:(.text.startup+0x3b6): undefined reference to `RTC_DS1307::begin()'

<artificial>:(.text.startup+0x3d8): undefined reference to `RTC_DS1307::isrunning()'

<artificial>:(.text.startup+0x400): undefined reference to `DateTime::DateTime(char const*, char const*)'

<artificial>:(.text.startup+0x408): undefined reference to `RTC_DS1307::adjust(DateTime const&)'

collect2.exe: error: ld returned 1 exit status

Going to remove the on off part from the program so can focus on reaching a solution to this. I am hoping after removing the onoff parts and figure out the references I need to add inside fetchTime() and the main body that it can compile.

  for (int x; x < 8; x++)

What is the initial value of x, bearing in mind that it is a local variable rather than a global ?

I removed that part since its not local to what I am trying to resolve, it was just a general code still to be config’d after connecting the relays to the arduino.

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
void fetchTime() {
	char* dateTime;
	DateTime now = rtc.now();
	char buffer[25] = "";
	sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
	dateTime = buffer;
}
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
	increase = 1,
	decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, fetchTime);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine offON(9, 0, onOFF);
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line, offON);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
 * LiquidSystem object combines the LiquidMenu objects to form
 * a menu system. It provides the same functions as LiquidMenu
 * with the addition of add_menu() and change_menu().
 */
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
	if (right.check() == LOW) {
		menu_system.next_screen();
	}
	if (left.check() == LOW) {
		menu_system.previous_screen();
	}
	if (up.check() == LOW) {
		menu_system.call_function(increase);
	}
	if (down.check() == LOW) {
		menu_system.call_function(decrease);
	}
	if (enter.check() == LOW) {
		menu_system.switch_focus();
	}
}

// Callback function that will be attached to back_line.
void go_back() {
	// This function takes reference to the wanted menu.
	menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
	menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
	menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
	if (pin6_level < 225) {
		pin6_level += 25;
	}
	else {
		pin6_level = 250;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void decrease_pin6() {
	if (pin6_level > 25) {
		pin6_level -= 25;
	}
	else {
		pin6_level = 0;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void save_input() {
	EEPROM.put(11, sample_period);
	input_saved = (char*)" *";
}

void save_output() {
	EEPROM.put(9, pin6_level);
	output_saved = (char*)" *";
}

void increase_samplePeriod() {
	if (sample_period < 10) {
		sample_period++;
		input_saved = (char*)"  ";
	}
}

void decrease_samplePeriod() {
	if (sample_period > 0) {
		sample_period--;
		input_saved = (char*)"  ";
	}
}



void setup() {
	Serial.begin(250000);

	pinMode(pin6, OUTPUT);

	// Reads the values recorded in the EEPROM
	EEPROM.get(9, pin6_level);
	EEPROM.get(11, sample_period);
	analogWrite(pin6, pin6_level);


	lcd.init();
	lcd.backlight();

	back_line.set_focusPosition(Position::LEFT);

	back_line.attach_function(1, go_back);
	back_line.attach_function(2, go_back);

	outputs_line.attach_function(1, goto_outputs_menu);
	outputs_line.attach_function(2, goto_outputs_menu);
	inputs_line.attach_function(1, goto_inputs_menu);
	inputs_line.attach_function(2, goto_inputs_menu);

	pin6_line.attach_function(increase, increase_pin6);
	pin6_line.attach_function(decrease, decrease_pin6);

	oSave_line.attach_function(1, save_output);
	oSave_line.attach_function(2, save_output);
	iSave_line.attach_function(1, save_input);
	iSave_line.attach_function(2, save_input);
	iSample_line.attach_function(increase, increase_samplePeriod);
	iSample_line.attach_function(decrease, decrease_samplePeriod);

	input_saved = (char*)" *";
	output_saved = (char*)" *";
	//relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
	//onOFF = (char *)"ON";

	menu_system.update();
}
void rtcSet()
{
	if (!rtc.begin()) {
		Serial.println("Couldn't find RTC");
		while (1);
	}
	if (!rtc.isrunning()) {
		Serial.println("RTC lost power, lets set the time!");
		// Comment out below lines once you set the date & time.
		  // Following line sets the RTC to the date & time this sketch was compiled
		rtc.adjust(DateTime(__DATE__, __TIME__));
	}
 rtcSet();
}

void loop() {
	buttonsCheck();
	static unsigned long lastMillis_sample = 0;
	if (millis() - lastMillis_sample > (sample_period * 1000)) {
		lastMillis_sample = millis();
		menu_system.update();
	}
}
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422/Sep8LiqFinalExp.ino.elf" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\sketch\\Sep8LiqFinalExp.ino.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\Wire\\Wire.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\Wire\\utility\\twi.c.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\LiquidCrystal_I2C\\LiquidCrystal_I2C.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\LiquidMenu-1.4.1\\LiquidLine.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\LiquidMenu-1.4.1\\LiquidMenu.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\LiquidMenu-1.4.1\\LiquidScreen.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\LiquidMenu-1.4.1\\LiquidSystem.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422\\libraries\\LiquidMenu-1.4.1\\recognizeType.cpp.o" "C:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422/..\\arduino_cache_616684\\core\\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\\Users\\Bob\\AppData\\Local\\Temp\\arduino_build_530422" -lm
C:\Users\Bob\AppData\Local\Temp\ccKX4Ybx.ltrans0.ltrans.o: In function `fetchTime()':

<artificial>:(.text+0x3a8): undefined reference to `RTC_DS1307::now()'

collect2.exe: error: ld returned 1 exit status

Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire 
Using library LiquidCrystal_I2C at version 1.1.2 in folder: C:\Users\Bob\Documents\Arduino\libraries\LiquidCrystal_I2C 
Using library LiquidMenu-1.4.1 at version 1.4.0 in folder: C:\Users\Bob\Documents\Arduino\libraries\LiquidMenu-1.4.1 
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM 
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
unsigned long dateTime;
double fetchTime(int dateTime) {
	char buffer[25] = "";
  DateTime now =  dateTime;
	sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
	dateTime == buffer;
}
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
	increase = 1,
	decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, dateTime);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
 * LiquidSystem object combines the LiquidMenu objects to form
 * a menu system. It provides the same functions as LiquidMenu
 * with the addition of add_menu() and change_menu().
 */
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
	if (right.check() == LOW) {
		menu_system.next_screen();
	}
	if (left.check() == LOW) {
		menu_system.previous_screen();
	}
	if (up.check() == LOW) {
		menu_system.call_function(increase);
	}
	if (down.check() == LOW) {
		menu_system.call_function(decrease);
	}
	if (enter.check() == LOW) {
		menu_system.switch_focus();
	}
}

// Callback function that will be attached to back_line.
void go_back() {
	// This function takes reference to the wanted menu.
	menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
	menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
	menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
	if (pin6_level < 225) {
		pin6_level += 25;
	}
	else {
		pin6_level = 250;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void decrease_pin6() {
	if (pin6_level > 25) {
		pin6_level -= 25;
	}
	else {
		pin6_level = 0;
	}
	analogWrite(pin6, pin6_level);
	output_saved = (char*)"  ";
}

void save_input() {
	EEPROM.put(11, sample_period);
	input_saved = (char*)" *";
}

void save_output() {
	EEPROM.put(9, pin6_level);
	output_saved = (char*)" *";
}

void increase_samplePeriod() {
	if (sample_period < 10) {
		sample_period++;
		input_saved = (char*)"  ";
	}
}

void decrease_samplePeriod() {
	if (sample_period > 0) {
		sample_period--;
		input_saved = (char*)"  ";
	}
}



void setup() {
	Serial.begin(250000);

	pinMode(pin6, OUTPUT);

	// Reads the values recorded in the EEPROM
	EEPROM.get(9, pin6_level);
	EEPROM.get(11, sample_period);
	analogWrite(pin6, pin6_level);


	lcd.init();
	lcd.backlight();

	back_line.set_focusPosition(Position::LEFT);

	back_line.attach_function(1, go_back);
	back_line.attach_function(2, go_back);

	outputs_line.attach_function(1, goto_outputs_menu);
	outputs_line.attach_function(2, goto_outputs_menu);
	inputs_line.attach_function(1, goto_inputs_menu);
	inputs_line.attach_function(2, goto_inputs_menu);

	pin6_line.attach_function(increase, increase_pin6);
	pin6_line.attach_function(decrease, decrease_pin6);

	oSave_line.attach_function(1, save_output);
	oSave_line.attach_function(2, save_output);
	iSave_line.attach_function(1, save_input);
	iSave_line.attach_function(2, save_input);
	iSample_line.attach_function(increase, increase_samplePeriod);
	iSample_line.attach_function(decrease, decrease_samplePeriod);

	input_saved = (char*)" *";
	output_saved = (char*)" *";
	//relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
	//onOFF = (char *)"ON";

	menu_system.update();
}
void rtcSet()
{
	if (!rtc.begin()) {
		Serial.println("Couldn't find RTC");
		while (1);
	}
	if (!rtc.isrunning()) {
		Serial.println("RTC lost power, lets set the time!");
		// Comment out below lines once you set the date & time.
		  // Following line sets the RTC to the date & time this sketch was compiled
		rtc.adjust(DateTime(__DATE__, __TIME__));
	}
 rtcSet();
}

void loop() {
	buttonsCheck();
	static unsigned long lastMillis_sample = 0;
	if (millis() - lastMillis_sample > (sample_period * 1000)) {
		lastMillis_sample = millis();
		menu_system.update();
	}
}

Compiles… but,

In file included from C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:4:0:

C:\Users\Bob\Documents\Arduino\libraries\LiquidMenu-1.4.1\src/LiquidMenu.h:55:97: note: #pragma message: LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.

 #pragma message ("LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.")

                                                                                                 ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino: In function 'double fetchTime(int)':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:14:14: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive]

  dateTime == buffer;

              ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:14:11: warning: statement has no effect [-Wunused-value]

  dateTime == buffer;

           ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:15:1: warning: no return statement in function returning non-void [-Wreturn-type]

 }

 ^

Anyone have any input on how to better do this? I’m wondering if this is doable with this menu library and maybe I should look into using switch case instead for the menu?

Read the warnings. They are trying to tell you important information:

keyboardcowboy:

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:14:11: warning: statement has no effect [-Wunused-value]

dateTime == buffer;

^

Do you see the problem. If not, please study these reference pages:

keyboardcowboy:

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:15:1: warning: no return statement in function returning non-void [-Wreturn-type]

}

^

Here's the function signature for your readTime function:

double fetchTime(int dateTime)

The "double" part is the return type. That indicates the function is supposed to return a value of the double data type. Yet your function doesn't return anything. If you don't intend the function to return anything, then it should have the void type. If you do intend it to return something, then you'd better add that code hadn't you?

Please study:
https://www.arduino.cc/reference/en/language/structure/control-structure/return/

pert:
Read the warnings. They are trying to tell you important information:
Do you see the problem. If not, please study these reference pages:

Here's the function signature for your readTime function:

double fetchTime(int dateTime)

The "double" part is the return type. That indicates the function is supposed to return a value of the double data type. Yet your function doesn't return anything. If you don't intend the function to return anything, then it should have the void type. If you do intend it to return something, then you'd better add that code hadn't you?

Please study:
return - Arduino Reference

I do my best to read and resolve any warnings, I kept trying different data types till it would compile, and wanted further input since this is going into uncharted territory for me to explore and learn. If there were no output errors available I would be dead in the water for sure.

I want the function to return time as I am just trying to print the time set to the rtc so I can have the relays on for a set time limit, it's just trying to find the correct data type in order to print on liquidline.

I tried alternatives like putting lcd.print() inside liquidline, just to find a alternative to setting the data type since having such issues, but the library won't allow it.

Again I am only trying to display time on liquidline that's set to the RTC. It's just unfortunate code format has to be changed due to a library when learning and not educated on the material well enough, which is now having me think I may out of luck with LiquidMenu and should possibly consider moving the menu to a switch case so as to try to avoid something I don't seem to have the ability to handle.

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
char dateTime;
double fetchTime(char dateTime) {
  char buffer[25] = "";
  DateTime now =  dateTime;
  sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
  dateTime = buffer;
  return dateTime;
}
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
  increase = 1,
  decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, dateTime);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
   LiquidSystem object combines the LiquidMenu objects to form
   a menu system. It provides the same functions as LiquidMenu
   with the addition of add_menu() and change_menu().
*/
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
  if (right.check() == LOW) {
    menu_system.next_screen();
  }
  if (left.check() == LOW) {
    menu_system.previous_screen();
  }
  if (up.check() == LOW) {
    menu_system.call_function(increase);
  }
  if (down.check() == LOW) {
    menu_system.call_function(decrease);
  }
  if (enter.check() == LOW) {
    menu_system.switch_focus();
  }
}

// Callback function that will be attached to back_line.
void go_back() {
  // This function takes reference to the wanted menu.
  menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
  menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
  menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
  if (pin6_level < 225) {
    pin6_level += 25;
  }
  else {
    pin6_level = 250;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void decrease_pin6() {
  if (pin6_level > 25) {
    pin6_level -= 25;
  }
  else {
    pin6_level = 0;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void save_input() {
  EEPROM.put(11, sample_period);
  input_saved = (char*)" *";
}

void save_output() {
  EEPROM.put(9, pin6_level);
  output_saved = (char*)" *";
}

void increase_samplePeriod() {
  if (sample_period < 10) {
    sample_period++;
    input_saved = (char*)"  ";
  }
}

void decrease_samplePeriod() {
  if (sample_period > 0) {
    sample_period--;
    input_saved = (char*)"  ";
  }
}



void setup() {
  Serial.begin(250000);

  pinMode(pin6, OUTPUT);

  // Reads the values recorded in the EEPROM
  EEPROM.get(9, pin6_level);
  EEPROM.get(11, sample_period);
  analogWrite(pin6, pin6_level);


  lcd.init();
  lcd.backlight();

  back_line.set_focusPosition(Position::LEFT);

  back_line.attach_function(1, go_back);
  back_line.attach_function(2, go_back);

  outputs_line.attach_function(1, goto_outputs_menu);
  outputs_line.attach_function(2, goto_outputs_menu);
  inputs_line.attach_function(1, goto_inputs_menu);
  inputs_line.attach_function(2, goto_inputs_menu);

  pin6_line.attach_function(increase, increase_pin6);
  pin6_line.attach_function(decrease, decrease_pin6);

  oSave_line.attach_function(1, save_output);
  oSave_line.attach_function(2, save_output);
  iSave_line.attach_function(1, save_input);
  iSave_line.attach_function(2, save_input);
  iSample_line.attach_function(increase, increase_samplePeriod);
  iSample_line.attach_function(decrease, decrease_samplePeriod);

  input_saved = (char*)" *";
  output_saved = (char*)" *";
  //relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
  //onOFF = (char *)"ON";

  menu_system.update();
}
void rtcSet()
{
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
    // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
  rtcSet();
}

void loop() {
  buttonsCheck();
  static unsigned long lastMillis_sample = 0;
  if (millis() - lastMillis_sample > (sample_period * 1000)) {
    lastMillis_sample = millis();
    menu_system.update();
  }
}
C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino: In function 'double fetchTime(char)':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:14:12: warning: invalid conversion from 'char*' to 'char' [-fpermissive]

   dateTime = buffer;

Again it compiles but I have a conversion error that would think would be solvable.

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
char* dateTime;
char* fetchTime(char* dateTime) {
  char buffer[25] = "";
  DateTime now =  dateTime;
  sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
  dateTime = buffer;
  return dateTime;
}
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
  increase = 1,
  decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, dateTime);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
   LiquidSystem object combines the LiquidMenu objects to form
   a menu system. It provides the same functions as LiquidMenu
   with the addition of add_menu() and change_menu().
*/
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
  if (right.check() == LOW) {
    menu_system.next_screen();
  }
  if (left.check() == LOW) {
    menu_system.previous_screen();
  }
  if (up.check() == LOW) {
    menu_system.call_function(increase);
  }
  if (down.check() == LOW) {
    menu_system.call_function(decrease);
  }
  if (enter.check() == LOW) {
    menu_system.switch_focus();
  }
}

// Callback function that will be attached to back_line.
void go_back() {
  // This function takes reference to the wanted menu.
  menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
  menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
  menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
  if (pin6_level < 225) {
    pin6_level += 25;
  }
  else {
    pin6_level = 250;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void decrease_pin6() {
  if (pin6_level > 25) {
    pin6_level -= 25;
  }
  else {
    pin6_level = 0;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void save_input() {
  EEPROM.put(11, sample_period);
  input_saved = (char*)" *";
}

void save_output() {
  EEPROM.put(9, pin6_level);
  output_saved = (char*)" *";
}

void increase_samplePeriod() {
  if (sample_period < 10) {
    sample_period++;
    input_saved = (char*)"  ";
  }
}

void decrease_samplePeriod() {
  if (sample_period > 0) {
    sample_period--;
    input_saved = (char*)"  ";
  }
}



void setup() {
  Serial.begin(250000);

  pinMode(pin6, OUTPUT);

  // Reads the values recorded in the EEPROM
  EEPROM.get(9, pin6_level);
  EEPROM.get(11, sample_period);
  analogWrite(pin6, pin6_level);


  lcd.init();
  lcd.backlight();

  back_line.set_focusPosition(Position::LEFT);

  back_line.attach_function(1, go_back);
  back_line.attach_function(2, go_back);

  outputs_line.attach_function(1, goto_outputs_menu);
  outputs_line.attach_function(2, goto_outputs_menu);
  inputs_line.attach_function(1, goto_inputs_menu);
  inputs_line.attach_function(2, goto_inputs_menu);

  pin6_line.attach_function(increase, increase_pin6);
  pin6_line.attach_function(decrease, decrease_pin6);

  oSave_line.attach_function(1, save_output);
  oSave_line.attach_function(2, save_output);
  iSave_line.attach_function(1, save_input);
  iSave_line.attach_function(2, save_input);
  iSample_line.attach_function(increase, increase_samplePeriod);
  iSample_line.attach_function(decrease, decrease_samplePeriod);

  input_saved = (char*)" *";
  output_saved = (char*)" *";
  //relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
  //onOFF = (char *)"ON";

  menu_system.update();
}
void rtcSet()
{
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
    // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
  rtcSet();
}

void loop() {
  buttonsCheck();
  static unsigned long lastMillis_sample = 0;
  if (millis() - lastMillis_sample > (sample_period * 1000)) {
    lastMillis_sample = millis();
    menu_system.update();
  }
}
In file included from C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:4:0:

C:\Users\Bob\Documents\Arduino\libraries\LiquidMenu-1.4.1\src/LiquidMenu.h:55:97: note: #pragma message: LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.

 #pragma message ("LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.")

                                                                                                 ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino: In function 'char* fetchTime(char*)':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:12:19: warning: invalid conversion from 'char*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

   DateTime now =  dateTime;

                   ^

In file included from C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:1:0:

C:\Users\Bob\AppData\Local\Temp\arduino_build_712598\sketch\RTClib.h:54:3: note:   initializing argument 1 of 'DateTime::DateTime(uint32_t)'

   DateTime (uint32_t t = SECONDS_FROM_1970_TO_2000);

   ^

I change it to what the error’s make me think it should be changed to, even though it compiles, I still get errors like this, after constistantly trying to find the correct conversion it still tries to stick it up my ass I feel.

It’s either buffer or dateTime I would think i’d want returned, dateTime has buffers data in it from the dateTime = buffer; call.

I uploaded but nothing shows on line 1,2… It’s just blank

#include "RTClib.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
char* dateTime;
char* fetchTime() {
  char buffer[25] = "";
  DateTime now =  dateTime;
  sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
  dateTime = buffer;
  return dateTime;
}
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
  increase = 1,
  decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};
int x;

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, fetchTime);
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
   LiquidSystem object combines the LiquidMenu objects to form
   a menu system. It provides the same functions as LiquidMenu
   with the addition of add_menu() and change_menu().
*/
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
  if (right.check() == LOW) {
    menu_system.next_screen();
  }
  if (left.check() == LOW) {
    menu_system.previous_screen();
  }
  if (up.check() == LOW) {
    menu_system.call_function(increase);
  }
  if (down.check() == LOW) {
    menu_system.call_function(decrease);
  }
  if (enter.check() == LOW) {
    menu_system.switch_focus();
  }
}

// Callback function that will be attached to back_line.
void go_back() {
  // This function takes reference to the wanted menu.
  menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
  menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
  menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
  if (pin6_level < 225) {
    pin6_level += 25;
  }
  else {
    pin6_level = 250;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void decrease_pin6() {
  if (pin6_level > 25) {
    pin6_level -= 25;
  }
  else {
    pin6_level = 0;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void save_input() {
  EEPROM.put(11, sample_period);
  input_saved = (char*)" *";
}

void save_output() {
  EEPROM.put(9, pin6_level);
  output_saved = (char*)" *";
}

void increase_samplePeriod() {
  if (sample_period < 10) {
    sample_period++;
    input_saved = (char*)"  ";
  }
}

void decrease_samplePeriod() {
  if (sample_period > 0) {
    sample_period--;
    input_saved = (char*)"  ";
  }
}



void setup() {
  Serial.begin(250000);

  pinMode(pin6, OUTPUT);

  // Reads the values recorded in the EEPROM
  EEPROM.get(9, pin6_level);
  EEPROM.get(11, sample_period);
  analogWrite(pin6, pin6_level);


  lcd.init();
  lcd.backlight();

  back_line.set_focusPosition(Position::LEFT);

  back_line.attach_function(1, go_back);
  back_line.attach_function(2, go_back);

  outputs_line.attach_function(1, goto_outputs_menu);
  outputs_line.attach_function(2, goto_outputs_menu);
  inputs_line.attach_function(1, goto_inputs_menu);
  inputs_line.attach_function(2, goto_inputs_menu);

  pin6_line.attach_function(increase, increase_pin6);
  pin6_line.attach_function(decrease, decrease_pin6);

  oSave_line.attach_function(1, save_output);
  oSave_line.attach_function(2, save_output);
  iSave_line.attach_function(1, save_input);
  iSave_line.attach_function(2, save_input);
  iSample_line.attach_function(increase, increase_samplePeriod);
  iSample_line.attach_function(decrease, decrease_samplePeriod);

  input_saved = (char*)" *";
  output_saved = (char*)" *";
  //relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
  //onOFF = (char *)"ON";

  menu_system.update();
}
void rtcSet()
{
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
    // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
  rtcSet();
}

void loop() {
  buttonsCheck();
  static unsigned long lastMillis_sample = 0;
  if (millis() - lastMillis_sample > (sample_period * 1000)) {
    lastMillis_sample = millis();
    menu_system.update();
  }
}

I tried to put the function in the liquidline, with the dateTime argument in paranthesis, but liquidline would return a error of to many arguments. So I deleted the argument and now get this output, which is leading me to assume I should remove the DateTime line in the function so it can compile.

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino: In function 'char* fetchTime()':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:12:19: warning: invalid conversion from 'char*' to 'uint32_t {aka long unsigned int}' [-fpermissive]

   DateTime now =  dateTime;

                   ^

In file included from C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:1:0:

C:\Users\Bob\AppData\Local\Temp\arduino_build_712598\sketch\RTClib.h:54:3: note:   initializing argument 1 of 'DateTime::DateTime(uint32_t)'

   DateTime (uint32_t t = SECONDS_FROM_1970_TO_2000);

   ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino: In function 'fetchTime':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:15:10: warning: function returns address of local variable [-Wreturn-local-addr]

   return dateTime;

          ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:11:8: note: declared here

   char buffer[25] = "";

        ^

C:\Users\Bob\AppData\Local\Temp\ccRACai6.ltrans0.ltrans.o: In function `fetchTime()':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp/Sep8LiqFinalExp.ino:12: undefined reference to `DateTime::DateTime(unsigned long)'

collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

I don’t seem to be getting anywhere but further away now

Really hoping someone has greater knowledge then myself and can show me how to display rtc on liquidline. I am using a ds1307. returning dateTime inside of the fetchTime() function doesn't work unfortunately. Really never thought by using a library I couldnt use code from a previously used arduino file.

#include <RTClib.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
  increase = 1,
  decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, "hi");
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
   LiquidSystem object combines the LiquidMenu objects to form
   a menu system. It provides the same functions as LiquidMenu
   with the addition of add_menu() and change_menu().
*/
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
  if (right.check() == LOW) {
    menu_system.next_screen();
  }
  if (left.check() == LOW) {
    menu_system.previous_screen();
  }
  if (up.check() == LOW) {
    menu_system.call_function(increase);
  }
  if (down.check() == LOW) {
    menu_system.call_function(decrease);
  }
  if (enter.check() == LOW) {
    menu_system.switch_focus();
  }
}

// Callback function that will be attached to back_line.
void go_back() {
  // This function takes reference to the wanted menu.
  menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
  menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
  menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
  if (pin6_level < 225) {
    pin6_level += 25;
  }
  else {
    pin6_level = 250;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void decrease_pin6() {
  if (pin6_level > 25) {
    pin6_level -= 25;
  }
  else {
    pin6_level = 0;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void save_input() {
  EEPROM.put(11, sample_period);
  input_saved = (char*)" *";
}

void save_output() {
  EEPROM.put(9, pin6_level);
  output_saved = (char*)" *";
}

void increase_samplePeriod() {
  if (sample_period < 10) {
    sample_period++;
    input_saved = (char*)"  ";
  }
}

void decrease_samplePeriod() {
  if (sample_period > 0) {
    sample_period--;
    input_saved = (char*)"  ";
  }
}



void setup() {
  Serial.begin(250000);
  //DateTime now = rtc.now();

  pinMode(pin6, OUTPUT);

  // Reads the values recorded in the EEPROM
  EEPROM.get(9, pin6_level);
  EEPROM.get(11, sample_period);
  analogWrite(pin6, pin6_level);


  lcd.init();
  lcd.begin(20,4);
  lcd.backlight();

  back_line.set_focusPosition(Position::LEFT);

  back_line.attach_function(1, go_back);
  back_line.attach_function(2, go_back);

  outputs_line.attach_function(1, goto_outputs_menu);
  outputs_line.attach_function(2, goto_outputs_menu);
  inputs_line.attach_function(1, goto_inputs_menu);
  inputs_line.attach_function(2, goto_inputs_menu);

  pin6_line.attach_function(increase, increase_pin6);
  pin6_line.attach_function(decrease, decrease_pin6);

  oSave_line.attach_function(1, save_output);
  oSave_line.attach_function(2, save_output);
  iSave_line.attach_function(1, save_input);
  iSave_line.attach_function(2, save_input);
  iSample_line.attach_function(increase, increase_samplePeriod);
  iSample_line.attach_function(decrease, decrease_samplePeriod);

  input_saved = (char*)" *";
  output_saved = (char*)" *";
  //relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
  //onOFF = (char *)"ON";

  menu_system.update();
}
void rtcSet(){
  DateTime now;
  now = rtc.now();
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
    // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
rtcSet();
}


void loop() {
  rtc.begin();
  buttonsCheck();
  static unsigned long lastMillis_sample = 0;
  if (millis() - lastMillis_sample > (sample_period * 1000)) {
    lastMillis_sample = millis();
    menu_system.update();
  }
}
In file included from C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:4:0:

C:\Users\Bob\Documents\Arduino\libraries\LiquidMenu-1.4.1\src/LiquidMenu.h:55:97: note: #pragma message: LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.

 #pragma message ("LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.")

Thats the only orange text in the compiler.

This is the cleanest I think I can get the program before the conversion needed to print the time from the rtc on liquidline3 for the welcome screen replacing hi. I am assuming just need to add a string buffer to the function and swap void for a returnable datatype so the time can be returned with return.

Would char be a good choice to replace void with? Planned on setting a array char buffer [25] = “”;

sprintf(buffer, “%04d/%02d/%02d, %02d:%02d:%02d”, now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
dateTime = buffer;

They have their function named void with no return and states it works?

Is there anyone who’d be able to write a example please?

#include <RTClib.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
  increase = 1,
  decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2, "hi");
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
   LiquidSystem object combines the LiquidMenu objects to form
   a menu system. It provides the same functions as LiquidMenu
   with the addition of add_menu() and change_menu().
*/
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
  if (right.check() == LOW) {
    menu_system.next_screen();
  }
  if (left.check() == LOW) {
    menu_system.previous_screen();
  }
  if (up.check() == LOW) {
    menu_system.call_function(increase);
  }
  if (down.check() == LOW) {
    menu_system.call_function(decrease);
  }
  if (enter.check() == LOW) {
    menu_system.switch_focus();
  }
}

// Callback function that will be attached to back_line.
void go_back() {
  // This function takes reference to the wanted menu.
  menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
  menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
  menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
  if (pin6_level < 225) {
    pin6_level += 25;
  }
  else {
    pin6_level = 250;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void decrease_pin6() {
  if (pin6_level > 25) {
    pin6_level -= 25;
  }
  else {
    pin6_level = 0;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void save_input() {
  EEPROM.put(11, sample_period);
  input_saved = (char*)" *";
}

void save_output() {
  EEPROM.put(9, pin6_level);
  output_saved = (char*)" *";
}

void increase_samplePeriod() {
  if (sample_period < 10) {
    sample_period++;
    input_saved = (char*)"  ";
  }
}

void decrease_samplePeriod() {
  if (sample_period > 0) {
    sample_period--;
    input_saved = (char*)"  ";
  }
}



void setup() {
  Serial.begin(250000);
  //DateTime now = rtc.now();

  pinMode(pin6, OUTPUT);

  // Reads the values recorded in the EEPROM
  EEPROM.get(9, pin6_level);
  EEPROM.get(11, sample_period);
  analogWrite(pin6, pin6_level);


  lcd.init();
  lcd.begin(20,4);
  lcd.backlight();

  back_line.set_focusPosition(Position::LEFT);

  back_line.attach_function(1, go_back);
  back_line.attach_function(2, go_back);

  outputs_line.attach_function(1, goto_outputs_menu);
  outputs_line.attach_function(2, goto_outputs_menu);
  inputs_line.attach_function(1, goto_inputs_menu);
  inputs_line.attach_function(2, goto_inputs_menu);

  pin6_line.attach_function(increase, increase_pin6);
  pin6_line.attach_function(decrease, decrease_pin6);

  oSave_line.attach_function(1, save_output);
  oSave_line.attach_function(2, save_output);
  iSave_line.attach_function(1, save_input);
  iSave_line.attach_function(2, save_input);
  iSample_line.attach_function(increase, increase_samplePeriod);
  iSample_line.attach_function(decrease, decrease_samplePeriod);

  input_saved = (char*)" *";
  output_saved = (char*)" *";
  //relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
  //onOFF = (char *)"ON";

  menu_system.update();
}
unsigned long rtcSet(){
  char* dateTime;
  DateTime now;
  now = rtc.now();
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
    // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
    char buffer[25] = "";
    sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
    dateTime = buffer;
  }
rtcSet();
}


void loop() {
  rtc.begin();
  buttonsCheck();
  static unsigned long lastMillis_sample = 0;
  if (millis() - lastMillis_sample > (sample_period * 1000)) {
    lastMillis_sample = millis();
    menu_system.update();
  }
}
In file included from C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:4:0:

C:\Users\Bob\Documents\Arduino\libraries\LiquidMenu-1.4.1\src/LiquidMenu.h:55:97: note: #pragma message: LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.

 #pragma message ("LiquidMenu: Configured for I2C. Edit 'LiquidMenu_config.h' file to change it.")

                                                                                                 ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino: In function 'long unsigned int rtcSet()':

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:215:9: warning: variable 'dateTime' set but not used [-Wunused-but-set-variable]

   char* dateTime;

         ^

C:\Users\Bob\Documents\Arduino\Sep8LiqFinalExp\Sep8LiqFinalExp.ino:232:1: warning: control reaches end of non-void function [-Wreturn-type]

 }

 ^

This compiles, should I write return dateTime; beneath dateTime = buffer;?

#include <RTClib.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidMenu.h>
#include <EEPROM.h>
#include "Button.h"
LiquidCrystal_I2C lcd(0x27, 20, 4);
RTC_DS1307 rtc;
// Button objects instantiation
const bool pullup = true;
Button left(8, pullup);
Button right(9, pullup);
Button up(10, pullup);
Button down(11, pullup);
Button enter(12, pullup);

// Pin definitions and variables for their state.
const byte pin6 = 6;
byte pin6_level = 0;

const byte pinA4 = A4;
byte pinA4_value = 0;

const byte pinA5 = A5;
byte pinA5_value = 0;

// The analog reading sample period in seconds.
// It is later overwritten by it's EEPROM value.
unsigned short sample_period = 2;

// Text used for indication for the save lines.
char* input_saved;
char* output_saved;
char* onOFF;

enum FunctionTypes {
  increase = 1,
  decrease = 2,
};

//char onOFF[] = {'ON', 'OFF'};

// A LiquidLine object can be used more that once.
LiquidLine back_line(11, 1, "/BACK");


LiquidLine welcome_line1(1, 0, "LiquidSenu ", LIQUIDMENU_VERSION);
LiquidLine welcome_line2(1, 1, "System example");
LiquidLine welcome_line3(1, 2,"");
LiquidScreen welcome_screen(welcome_line1, welcome_line2, welcome_line3);

// These lines direct to other menus.
LiquidLine outputs_line(0, 0, "/Outputs ");
LiquidLine inputs_line(0, 1, "/Inputs");
LiquidScreen io_screen(outputs_line, inputs_line);

// This is the first menu.
LiquidMenu main_menu(lcd, welcome_screen, io_screen, 1);


LiquidLine pin6_line(0, 0, "Pin 6: ", pin6_level);
LiquidScreen pin6_screen(pin6_line);

LiquidLine oSave_line(0, 0, "Save", output_saved);
LiquidScreen oSecondary_screen(oSave_line, back_line);

// This is the second menu.
LiquidMenu outputs_menu(lcd, pin6_screen, oSecondary_screen);


LiquidLine pinA4_line(0, 0, "Pin A4: ", pinA4_value);
LiquidLine pinA5_line(0, 1, "Pin A5: ", pinA5_value);
LiquidScreen pinsA4_A5_screen(pinA4_line, pinA5_line);

LiquidLine iSample_line(0, 0, "Sample: ", sample_period, "s");
LiquidLine iSave_line(0, 1, "Save", input_saved);
LiquidScreen iSecondary_screen(iSample_line, iSave_line, back_line);

// And this is the final third menu.
LiquidMenu inputs_menu(lcd, pinsA4_A5_screen, iSecondary_screen);

/*
   LiquidSystem object combines the LiquidMenu objects to form
   a menu system. It provides the same functions as LiquidMenu
   with the addition of add_menu() and change_menu().
*/
LiquidSystem menu_system(main_menu, outputs_menu, inputs_menu);


// Checks all the buttons.
void buttonsCheck() {
  if (right.check() == LOW) {
    menu_system.next_screen();
  }
  if (left.check() == LOW) {
    menu_system.previous_screen();
  }
  if (up.check() == LOW) {
    menu_system.call_function(increase);
  }
  if (down.check() == LOW) {
    menu_system.call_function(decrease);
  }
  if (enter.check() == LOW) {
    menu_system.switch_focus();
  }
}

// Callback function that will be attached to back_line.
void go_back() {
  // This function takes reference to the wanted menu.
  menu_system.change_menu(main_menu);
}

void goto_outputs_menu() {
  menu_system.change_menu(outputs_menu);
}

void goto_inputs_menu() {
  menu_system.change_menu(inputs_menu);
}

void increase_pin6() {
  if (pin6_level < 225) {
    pin6_level += 25;
  }
  else {
    pin6_level = 250;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void decrease_pin6() {
  if (pin6_level > 25) {
    pin6_level -= 25;
  }
  else {
    pin6_level = 0;
  }
  analogWrite(pin6, pin6_level);
  output_saved = (char*)"  ";
}

void save_input() {
  EEPROM.put(11, sample_period);
  input_saved = (char*)" *";
}

void save_output() {
  EEPROM.put(9, pin6_level);
  output_saved = (char*)" *";
}

void increase_samplePeriod() {
  if (sample_period < 10) {
    sample_period++;
    input_saved = (char*)"  ";
  }
}

void decrease_samplePeriod() {
  if (sample_period > 0) {
    sample_period--;
    input_saved = (char*)"  ";
  }
}



void setup() {
  Serial.begin(250000);
  //DateTime now = rtc.now();

  pinMode(pin6, OUTPUT);

  // Reads the values recorded in the EEPROM
  EEPROM.get(9, pin6_level);
  EEPROM.get(11, sample_period);
  analogWrite(pin6, pin6_level);


  lcd.init();
  lcd.begin(20,4);
  lcd.backlight();

  back_line.set_focusPosition(Position::LEFT);

  back_line.attach_function(1, go_back);
  back_line.attach_function(2, go_back);

  outputs_line.attach_function(1, goto_outputs_menu);
  outputs_line.attach_function(2, goto_outputs_menu);
  inputs_line.attach_function(1, goto_inputs_menu);
  inputs_line.attach_function(2, goto_inputs_menu);

  pin6_line.attach_function(increase, increase_pin6);
  pin6_line.attach_function(decrease, decrease_pin6);

  oSave_line.attach_function(1, save_output);
  oSave_line.attach_function(2, save_output);
  iSave_line.attach_function(1, save_input);
  iSave_line.attach_function(2, save_input);
  iSample_line.attach_function(increase, increase_samplePeriod);
  iSample_line.attach_function(decrease, decrease_samplePeriod);

  input_saved = (char*)" *";
  output_saved = (char*)" *";
  //relayState(onOFF) takes over for the code below, accepts onOFF and changes the string assignment to onOFF
  //onOFF = (char *)"ON";

  menu_system.update();
}
void rtcSet(char* dateTime){
  DateTime now;
  now = rtc.now();
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  if (!rtc.isrunning()) {
    Serial.println("RTC lost power, lets set the time!");
    // Comment out below lines once you set the date & time.
    // Following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
    char buffer[25] = "";
    sprintf(buffer, "%04d/%02d/%02d, %02d:%02d:%02d", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());
    dateTime = buffer;
  }
rtcSet(dateTime);
}


void loop() {
  rtc.begin();
  buttonsCheck();
  static unsigned long lastMillis_sample = 0;
  if (millis() - lastMillis_sample > (sample_period * 1000)) {
    lastMillis_sample = millis();
    menu_system.update();
  }
}
C:\Users\Bob\Documents\Arduino\libraries\RTClib\RTClib.cpp: In constructor 'DateTime::DateTime(uint32_t)':

C:\Users\Bob\Documents\Arduino\libraries\RTClib\RTClib.cpp:154:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

     if (days < 365 + leap)

After doing further research after trying to return ‘dateTime’, I found this.

Which says to assign the function to a void and pass the variable would like to use as a argument.
I’m hoping this works.