#include*<
Keypad.h>
#include*<
LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// initialize the library with the numbers of the interface pins
const byte ROWS = 4;
//four rows
const byte COLS = 4;
//three columns
char keys[ROWS][COLS] = {
**{
'1',
'4',
'7',
'*'},
**{
'2',
'5',
'8',
'0'},
**{
'3',
'6',
'9',
'#'},
**{
'.',
'B',
'C',
'D'},
};
byte rowPins[ROWS] = {33, 32, 31, 30};
//connect to the row pinouts of the keypad
byte colPins[COLS] = {37, 36, 35, 34};
//connect to the column pinouts of the keypad
*
Keypad keypad =
Keypad(
makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int t;
// motoghayer baraye neveshtan keypad roye lcd
int t1;
int q;
int x;
int v;
int b;
int n;
int q1;
int x1;
int v1;
int b1;
int n1;
void setup(){
**
Serial.
begin(9600);
// open serial at 9600 bps
**lcd.
begin(20, 4);
**lcd.
setCursor(4, 0);
**lcd.
print(
"enter ts & sh");
**
Serial.
print(
"enter ts & sh");
**lcd.
setCursor(0,1);
**lcd.
print(
"TS:");
**
Serial.
print(
"ts");
**lcd.
setCursor(0,2);
**lcd.
print(
"SH:");
**
Serial.
print(
"sh");
***
//-------------keypad------------------------
****t*=*3;
****
while(t < 8){
****
char key =
keypad.
getKey();
****
if (key !=
NO_KEY){
****lcd.
setCursor(t, 1);
****lcd.
print(key);
****
Serial.
println();
****
Serial.
print(key);
****
delay(250);
**
//-----------------------------------------------
****
if ( t==3)
***{
*****q=key;
****
***}
***
if (t==4){
*****x=key;
***
***}
****
if (t==5){
*****v=key;
***}
****
if (t==6){
*****b=key;
***}
****
if (t==7){
****n=key;*
***}
***
//---------------------------------
*}
*}
//--------------------------------------------------**
***t1*=3;
**
while(t1 < 8){
**
char key =
keypad.
getKey();
**
if (key !=
NO_KEY){
****lcd.
setCursor(t1, 2);
**
****lcd.
print(key);
****
Serial.
println();
****
Serial.
print(key);
**
**
delay(250);
**
***********
//---------------------------------------------
***
if ( t1==3)
***{
*****q1=key;
***}
***
if (t1==4){
*****x1=key;
***}
****
if (t1==5){
*****v1=key;
***}
****
if (t1==6){
*****b1=key;
***}
****
if (t1==7){
****n1=key;
***}
***
//---------------------------------
*t1++;*******
**}**
}
lcd.
clear();
}
void loop(){
**
//--------------lcd--------------------
**lcd.
setCursor(12,0);
**lcd.
print(
"TS:");
**
Serial.
println(
"TS:");
**lcd.
setCursor(15,0);
**
Serial.
print(q);
**lcd.
print(x);
**
Serial.
print(x);
**lcd.
print(v);
**
Serial.
print(v);
**lcd.
print(b);
**
Serial.
print(b);
**lcd.
print(n);
**
Serial.
print(n);
*
//-----------------
**lcd.
setCursor(12,1);
**lcd.
print(
"SH:");
**
Serial.
println(
"sh");
**lcd.
setCursor(15,1);
**lcd.
print(q1);
**lcd.
print(x1);
**
Serial.
print(x1);
**lcd.
print(v1);
**
Serial.
print(v1);
**lcd.
print(b1);
**
Serial.
print(b1);
**lcd.
print(n1);
**
Serial.
print(n1);
}
**