If you need my full code Here it is,
///LCD///
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
int XLCD;;
int YLCD;;
////
///Keypad///
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
/////
int Value;
int Value2;
String Length;
String Width;
String Hole;
String Hook;
String theChar;
void setup()
{
XLCD=7;
YLCD=0;
lcd.init();
lcd.backlight();
Serial.begin(9600);
//customKeypad.begin();
lcd.setCursor(0, 0);
lcd.setCursor(0,0);
lcd.print("Length:");
lcd.setCursor(0,1);
lcd.print("Width:");
lcd.setCursor(0,2);
lcd.print("Hole Size:");
lcd.setCursor(0,3);
lcd.print("Hook:");
lcd.setCursor(XLCD,YLCD);
lcd.blink();
}
void loop()
{
char customKey = customKeypad.getKey();
lcd.setCursor(XLCD,YLCD);
lcd.blink();
if (customKey == '1')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("1");
Value++;
theChar="1";
}
if (customKey == '2')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("2");
Value++;
theChar="2";
}
if (customKey == '3')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("3");
Value++;
theChar="3";
}
if (customKey == '4')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("4");
Value++;
theChar="4";
}
if (customKey == '5')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("5");
Value++;
theChar="5";
}
if (customKey == '6')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("6");
Value++;
theChar="6";
}
if (customKey == '7')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("7");
Value++;
theChar="7";
}
if (customKey == '8')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("8");
Value++;
theChar="8";
}
if (customKey == '9')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("9");
Value++;
theChar="9";
}
if (customKey == 'C')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("C");
Value++;
theChar="C";
}
if (customKey == 'D')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("D");
Value++;
theChar="D";
}
if (customKey == '0')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("0");
Value++;
theChar="0";
}
if (customKey == '*')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("*");
Value++;
}
if (customKey == '#')
{
//lcd.clear();
lcd.setCursor(XLCD++,YLCD);
lcd.print("#");
Value++;
}
//if (Value>3&&Value<5)
if (Value == 3)
{
lcd.setCursor(XLCD++,YLCD);
lcd.print(".");
Value++;
}
String L1;
String L2;
String L3;
String L4=".";
String L5;
String L6;
String L7;
if(XLCD==7&&YLCD==0)
{
L1= theChar;
}
if(XLCD==8&&YLCD==0)
{
L2= theChar;
}
if(XLCD==9&&YLCD==0)
{
L3= theChar;
}
if(XLCD==11&&YLCD==0)
{
L5= theChar;
}
if(XLCD==12&&YLCD==0)
{
L6= theChar;
}
if(XLCD==13&&YLCD==0)
{
L7= theChar;
}
Length=L2+L3+L4+L5+L6+L7;
Serial.println(Length);
if (customKey == 'A')
{
if (YLCD== 0)
{
YLCD=1;
XLCD = 6;
lcd.blink();
}
else if (YLCD== 1)
{
YLCD=2;
XLCD = 10;
lcd.blink();
}
else if (YLCD== 2)
{
YLCD=3;
XLCD = 5;
lcd.blink();
}
else if (YLCD== 3)
{
YLCD=0;
XLCD=7;
lcd.blink();
}
Value=0;
}
if (customKey == 'B')
{
if (YLCD== 0)
{
YLCD=3;
XLCD = 5;
lcd.blink();
}
else if (YLCD== 1)
{
YLCD=0;
XLCD = 7;
lcd.blink();
}
else if (YLCD== 2)
{
YLCD=1;
XLCD = 6;
lcd.blink();
}
else if (YLCD== 3)
{
YLCD=2;
XLCD=10;
lcd.blink();
}
Value=0;
}
}