0% found this document useful (0 votes)
6 views2 pages

Keypad & LCD

The document describes an experiment involving the interfacing of an LCD and a keypad to display pressed keys. It includes code for setting up the LCD and keypad using Arduino libraries. The program initializes the LCD, displays a message, and updates the display with the key pressed by the user.

Uploaded by

cisikij108
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Keypad & LCD

The document describes an experiment involving the interfacing of an LCD and a keypad to display pressed keys. It includes code for setting up the LCD and keypad using Arduino libraries. The program initializes the LCD, displays a message, and updates the display with the key pressed by the user.

Uploaded by

cisikij108
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

------------------------------------------------------------------------------------------------------------------------------

Experiment No.3

Name of the Experiment : Interfacing of LCD to display the message and interface

with keypad to display the key pressed.

Name of the Student : Shivamkumar Anand Dhurandhar Roll No:1


Batch :S1

Class :SE (Mechanical) (Div A) Academic Year :2018-19 (Sem II)


--------------------------------------------------------------------------------------------------------------------------------

#include <Keypad.h>

#include <LiquidCrystal.h>

LiquidCrystal lcd(8,9,10,11,12,13); //lcd object

char keys[4][4]= {

//char keys[ROWS][COLS] = {

{'0','1','2','3'},

{'4','5','6','7'},

{'8','9','A','B'},

{'C','D','E','F'}

};

byte rowPins[4] = {4, 5, 6, 7}; //connect to the row pinouts of the kpd

byte colPins[4] = {0, 1, 2, 3}; //connect to the column pinouts of the kpd

Keypad mykeypad = Keypad( makeKeymap(keys), rowPins, colPins, 4, 4 ); //keypad


object

void setup() {

// put your setup code here, to run once:


lcd.begin(16, 2);

lcd.setCursor(0,0); //set cursor of LCD to Column 0 & Row 0

lcd.print("Pressed key is:"); //print message on LCD

void loop() {

// put your main code here, to run repeatedly:

char key = mykeypad.getKey();

if(key)

lcd.setCursor(15,0); //set cursor of LCD to Column 15 & Row 0

lcd.print(key); //print the state of pressed key

You might also like