Anda di halaman 1dari 7

LAB.

MDM KELAS XI TEI


SMK ABDI SEJATI KERASAAN 1

JOB 4 Menampilkan Karakter, Running Text dan Pushbutton di LCD 16:2

1. Tujuan
a. Dapat menggambar dan memahami rangkaian menampilkan karakter pada LCD 16 : 2
b. Menerapkan rangkaian ini secara real menggunakan Arduino UNO dan NANO
c. Mengenal dan memahami tiap perintah program yang dituliskan pada simulator Arduino
2. Gambar rangkaian
a. Arduino UNO
 Schematic Rangkaian
1. UNO
LAB. MDM KELAS XI TEI
SMK ABDI SEJATI KERASAAN 1

2. NANO
LAB. MDM KELAS XI TEI
SMK ABDI SEJATI KERASAAN 1

 Coding 1 Manampilkan Karakter Pada LCD 16:2


// MANAMPILKAN KARAKTER PADA LCD 16:2
#include <LiquidCrystal.h>
const int PIN_RS = 7 ;
const int PIN_E = 6 ;
const int PIN_D4 = 5 ;
const int PIN_D5 = 4 ;
const int PIN_D6 = 3 ;
const int PIN_D7 = 2 ;
LiquidCrystal lcd(PIN_RS,PIN_E,PIN_D4,PIN_D5,PIN_D6,PIN_D7 );
void setup()
{

lcd.begin(16, 2);
lcd.setCursor(2,0);
lcd.print("KELAS XI TEI");
lcd.setCursor(0,1);
lcd.print("SMK ABDI SEJATI");
delay (500);
lcd.clear ();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("NAMA :.......?");
lcd.setCursor(0,1);
lcd.print("GRUP :.......?");
delay (100);
lcd.clear ();

 Coding 2 MENAMPILKAN PER KARAKTER


// MENAMPILKAN PER KARAKTER
#include <LiquidCrystal.h>
const int PIN_RS = 7 ;
const int PIN_E = 6 ;
const int PIN_D4 = 5 ;
const int PIN_D5 = 4 ;
const int PIN_D6 = 3 ;
const int PIN_D7 = 2 ;
LiquidCrystal lcd(PIN_RS,PIN_E,PIN_D4,PIN_D5,PIN_D6,PIN_D7 );
int t1 = 200;
int t2 = 100;
int t3 = 1000;

void setup()
{
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("SELAMAT DATANG..");
lcd.setCursor(2,1);
LAB. MDM KELAS XI TEI
SMK ABDI SEJATI KERASAAN 1

lcd.print("KELAS XI TEI");
delay (t3);
lcd.clear();

void loop() {
lcd.setCursor(0,0);
lcd.print("S");delay(t1);
lcd.print("M");delay(t2);
lcd.print("K");delay(t2);
lcd.print(" ");delay(t2);
lcd.print("A");delay(t2);
lcd.print("B");delay(t2);
lcd.print("D");delay(t1);
lcd.print("I");delay(t2);
lcd.print(" ");delay(t2);
lcd.print("S");delay(t2);
lcd.print("E");delay(t2);
lcd.print("J");delay(t2);
lcd.print("A");delay(t2);
lcd.print("T");delay(t2);
lcd.print("I");delay(t2);

lcd.setCursor(3,1);
lcd.print("K");delay(t2);
lcd.print("E");delay(t2);
lcd.print("R");delay(t2);
lcd.print("A");delay(t2);
lcd.print("S");delay(t2);
lcd.print("A");delay(t2);
lcd.print("A");delay(t2);
lcd.print("N");delay(t2);
lcd.print(" ");delay(t2);
lcd.print("1");delay(t2);
delay (t3);
lcd.clear();

 Coding 3 MANAMPILKAN RUNNING TEXT PADA LCD 16 : 2


// MANAMPILKAN RUNNING TEXT PADA LCD 16 : 2
#include <LiquidCrystal.h>
const int PIN_RS = 7 ;
const int PIN_E = 6 ;
const int PIN_D4 = 5 ;
const int PIN_D5 = 4 ;
const int PIN_D6 = 3 ;
const int PIN_D7 = 2 ;
LiquidCrystal lcd(PIN_RS,PIN_E,PIN_D4,PIN_D5,PIN_D6,PIN_D7 );
LAB. MDM KELAS XI TEI
SMK ABDI SEJATI KERASAAN 1

int i;
void setup()
{

lcd.begin(16, 2);
lcd.setCursor(2,0);
lcd.print("KELAS XI TEI");
lcd.setCursor(0,1);
lcd.print("SMK ABDI SEJATI");
delay (500);
lcd.clear ();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("NAMA :.......?");
lcd.setCursor(0,1);
lcd.print("GRUP :.......?");

for (i = 0 ; i <= 16; i++)


{
lcd.scrollDisplayRight();
delay(300);

for (i = 0 ; i <= 16; i++)


{
lcd.scrollDisplayLeft();
delay(300);

 Coding 4 Manampilkan Text Menggunakan Push Button Pada LCD 16 : 2


// MANAMPILKAN TEXT MENGGUNAKAN PUSH BUTTON PADA LCD 16 : 2
#include <LiquidCrystal.h>
const int PIN_RS = 7 ;
const int PIN_E = 6 ;
const int PIN_D4 = 5 ;
const int PIN_D5 = 4 ;
const int PIN_D6 = 3 ;
const int PIN_D7 = 2 ;
LiquidCrystal lcd(PIN_RS,PIN_E,PIN_D4,PIN_D5,PIN_D6,PIN_D7 );
const int t1 = A0;
const int t2 = A1;

void setup()
{

pinMode(t1,INPUT_PULLUP);
LAB. MDM KELAS XI TEI
SMK ABDI SEJATI KERASAAN 1

pinMode(t2,INPUT_PULLUP);
lcd.begin(16, 2);
lcd.setCursor(2,0);
lcd.print("KELAS XI TEI");
lcd.setCursor(0,1);
lcd.print("SMK ABDI SEJATI");
delay (500);
lcd.clear();

}
void loop()
{
lcd.setCursor(0,0);
lcd.print("Tombol adalah :");
delay(100);
lcd.clear();

if(digitalRead(t1)==LOW)
{
lcd.setCursor(0,1);
lcd.print("tombol 1");
delay(500);
lcd.clear();
}

if(digitalRead(t2)==LOW)
{
lcd.setCursor(5,1);
lcd.print("tombol 2");
delay(500);
lcd.clear();
}

}
LAB. MDM KELAS XI TEI
SMK ABDI SEJATI KERASAAN 1

LAPORAN HASIL PRAKTIKUM # 4

NAMA :

KELAS :

TANGGAL PELAKSANAAN :

JUDUL PRAKTIKUM :

NO FAKTOR PENILAIAN NILAI


1 Pelaksanaan Praktikum

2 Laporan Hasil Praktikum

3 Nilai Akhir

4 Validasi Guru Tanggal :

JAWABAN :

Anda mungkin juga menyukai