//INCLUDE KEYPAD AND LCD LIBRARY
#include <Keypad.h>
#include <LiquidCrystal.h>
//Keypad row and colomn sizes
const byte ROWS = 4;
const byte COLS = 4;
// Array to represent keys on keypad
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
//keypad connections to Arduino,,,pins
byte rowPins[ROWS] = {9,8,7,6};
byte colPins[COLS] = {5,4,3,2};
//lcd connections to Arduino,,,pins
LiquidCrystal lcd(A0, A1, 13, 12, 11, 10);
//Create a Keypad object
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
//end dead
void setup() {
// put your setup code here, to run once
//LCD STARTREAD???
lcd.begin(16, 2);
// Set up serial monitor
Serial.begin(9600);
// all done here
Serial.println("SETUP COMPLETE");
lcd.print("WELCOME");
//end setup
}
void loop() {
// put your main code here, to run repeatedly:
// Get key value if pressed
char customKey = customKeypad.getKey();
if (customKey){
//Print key value to serial monitor
Serial.println(customKey);
//print to lcd
lcd.clear();
lcd.setCursor(0,0);
lcd.print(customKey);
}
//end loop
}