Hi, Good Afternoon!
I'm currently working on interfacing a 3x4 keypad with 4x16 lcd screens with an Arduino Uno(attached). The components that I used are shift register 74HC595, Uno, keypad, contrast, lcd and 4 resistors(220ohm).
The objective is to allow the lcd screen to show the button that is being pressed on the keypad (such as, pressed "A" on the keypad and shows "A" on the lcd screen.
The issue currently I'm facing is this, whenever I pressed a button on the keypad, the Arduino RX lights but does not show anything on the screen.
Please advise on how can I allow the lcd to capture the button I pressed on the keypad. Thanks alot.
The code that I used is:
/* @file HelloKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
}
void loop(){
char key = keypad.getKey();
if (key){
Serial.println(key);
}
}