https://www.youtube.com/watch?v=Q58mQFwWv7c&t=44s
// include the LiquidCrystal.h library
#include <LiquidCrystal.h>
const int numOfInputs = 4;
const int inputPins[numOfInputs] = {5,4,3,2};
// input and button logic
int inputState[numOfInputs] = {LOW, LOW, LOW, LOW};
bool inputFlags[numOfInputs] = {LOW, LOW, LOW, LOW};
long lastDebounceTime[numOfInputs] = {0,0,0,0};
long debounceDelay = 10;
// lcd menu logic
const int numOfScreens = 10;
int currentScreen = 0;
String screens[numOfScreens][2] = {{"Motor Voltage", "Volts"}, {"Motor Current", "Amps"},
{"Motor Rated HP", "HP"}, {"Overload Temp.", "degC"}, {"Accel Time", "Secs"},
{"RestartTime", "Mins"}, {"Analog Out. Curr.", "mA"}, {"Input Temp.", "degC"},
{"Run Time", "Hours"}, {"Start Times", "Times"}};
int parameters[numOfScreens];
//String parametersUnits[numOfScreens] = {"", "Amps", "HP", "degC", "Secs", "Mins", "mA", "degC", "Hours", "times"};
const int rs = 7; // Pin 7 on Arduino to pin 4 (RS) on LCD
const int en = 6; // Pin 6 on Arduino to pin 6 (E) on LCD
const int d4 = 12; // Pin 12 on Arduino to pin 11 (D4) on LCD
const int d5 = 10; // Pin 10 on Arduino to pin 12 (D5) on LCD
const int d6 = 9; // Pin 9 on Arduino to pin 13 (D6) on LCD
const int d7 = 8; // Pin 8 on Arduino to pin 14 (D7) on LCD
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// Set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print Hello World! to the LCD.
for (int i = 0; i < numOfInputs; i++){
pinMode(inputPins[i], INPUT);
digitalWrite(inputPins[i], HIGH);
}
}
void loop() {
// The location of line one is 0
// The location of line two is 1
// set the cursor to column 0, line 1 the print the second line
lcd.setCursor(0, 1);
lcd.print("Seconds ");
lcd.print(millis() / 1000);
}