0% found this document useful (0 votes)
0 views3 pages

Keypad

The document outlines an experiment aimed at interfacing a 3x3 matrix keypad with an Arduino board to display pressed keys on a serial monitor. It includes a list of apparatus, a circuit diagram, and a program that detects key presses and prints the corresponding key to the serial monitor. The program utilizes the Keypad library to manage the keypad input and handle the output effectively.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

Keypad

The document outlines an experiment aimed at interfacing a 3x3 matrix keypad with an Arduino board to display pressed keys on a serial monitor. It includes a list of apparatus, a circuit diagram, and a program that detects key presses and prints the corresponding key to the serial monitor. The program utilizes the Keypad library to manage the keypad input and handle the output effectively.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Experiment No-5

AIM: Interfacing of keypad with Arduino embedded target board as 3×3 matrix and display the pressed
key on serial monitor.

APPARATURS:

1. Arduino embedded target board


2. Keypad

CIRCUIT DIAGRAM:
PROGRAM:

#include <Keypad.h>
const byte ROWS = 3; //three rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] =
{
{'1','2','3'},
{'4','5','6'},
{'7','8','9'}
};

byte rowPins[ROWS] = {11, 10, 9};


//connect to the row pins of keypad
byte colPins[COLS] = {7, 6, 5};
//connect to the column pins of keypad
Keypad keypad = Keypad(
makeKeymap(keys), rowPins, colPins, ROWS,
COLS );
void setup()
{
[Link](9600);
}
void loop()
{
char key = [Link]();
if (key == '1')
{
[Link]("Key Pressed= 1");
}
if (key == '2')
{
[Link]("Key Pressed= 2");
}
if (key == '3')
{
[Link]("Key Pressed= 3");
}
if (key == '4')
{
[Link]("Key Pressed= 4");
}
if (key == '5')
{
[Link]("Key Pressed= 5");
}
if (key == '6')
{
[Link]("Key Pressed= 6");
}
if (key == '7')
{
[Link]("Key Pressed= 7");
}
if (key == '8')
{
[Link]("Key Pressed= 8");
}
if (key == '9')
{
[Link]("Key Pressed= 9");
}
}

Conclusion:

You might also like