0% found this document useful (0 votes)
37 views5 pages

Modul V Keypad A. Tujuan

The document describes an experiment using an Arduino, keypad, and LCD to display keypad input on the LCD. It lists the objectives, materials, and steps to connect the components and upload a program to read keypad input and display it on the LCD, incrementing the column position each time. The program code is provided to initialize the LCD and keypad, read keypad input in a loop, and print it to the LCD.

Uploaded by

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

Modul V Keypad A. Tujuan

The document describes an experiment using an Arduino, keypad, and LCD to display keypad input on the LCD. It lists the objectives, materials, and steps to connect the components and upload a program to read keypad input and display it on the LCD, incrementing the column position each time. The program code is provided to initialize the LCD and keypad, read keypad input in a loop, and print it to the LCD.

Uploaded by

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

MODUL V

KEYPAD

A. TUJUAN
1. Memahami cara mengirim data dari keypad ke arduino.
2. Memahami cara menampilkan data dari keypad ke LCD.

B. ALAT DAN BAHAN


1) Arduino
2) Laptop
3) Kabel USB Connector Arduino ke Laptop
4) LCD
5) Kabel Jumper
6) Keypad

C. DASAR TEORI
D. LANGKAH PERCOBAAN
1) Menyiapkan alat dan bahan percobaan
2) Menyusun rangkaian seperti gambar berikut

3) Memasang USB kabel pada arduino dengan port USB yang terdapat
pada PC untuk mengupload program.
4) Membuka IDE Arduino , lalu ketikkan program berikut :
#include <Keypad.h>
#include <LiquidCrystali2C.h>

LiquidCrystal lcd(28, 30, 5, 4, 3, 2);


const byte rows = 4;
const byte cols = 4;
int coloumn = 0;
char keys [rows][cols] =
{
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};

byte rowPins [rows] = {9, 8, 7, 6};


byte colPins [cols]= {13, 12, 11, 10};
Keypad keypad = Keypad(makeKeymap(keys), rowPins,
colPins, rows, cols);

void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2);
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
char key = keypad.getKey();
if(key == '1' || key == '2' || key == '3' || key ==
'4' || key == '5' || key == '6' || key == '7' ||
key == '8' || key == '9' || key == '0' || key ==
'A' || key == 'B' || key == 'D' ||
key == '*' || key == '#' || key == 'C'){
lcd.setCursor(coloumn, 0);
lcd.print(key);
coloumn = coloumn + 1;
if(coloumn > 15){
lcd.clear();
coloumn = 0;
}
}
}

5) Mengcompile dan upload program yang telah di ketik tersebut ke


arduino
6) Mencatat hasil yang didapatkan.
E. DATA HASIL

No. Karakter Kolom Baris


1.
2.
3.
4.
5.

You might also like