You are on page 1of 9

LAPORAN SEMENTARA

PRAKTIKUM MICROCONTROLLER
UNIT 5
LIQUID CRSYTAL DISPLAY

Oleh:
Nama : M Arifin Wardana

David Danendra R

Hilmi Pramono Adi


NIM : 22/493045/SV/20655

22/496884/SV/21041
22/503024/SV/21463
Kelas : RE3A1
Dosen Pengampu : Budi Bayu Murti, S.T., M.T

Asisten : 1. Faizal Azmi Nurwardani

2. Abi Azka Najasyi


Laboran : Sugeng Julianto, S.ST.
Hari, Tangal : Senin, 18 September 2023

PROGRAMSTUDITEKNOLOGIREKAYASAELEKTRO
DEPARTEMENTEKNIKELEKTRODANINFORMATIKA
SEKOLAHVOKASI
UNIVERSITASGADJAHMADA
2023
UNIT 5
LIQUID CRSYTAL DISPLAY

FlowChart
Program 1

Program 2
PROGRAM 3
PROGRAM 1
#include <LiquidCrystal.h>
LiquidCrystal lcd(36, 34, 32, 30, 28, 26);
byte smile[8] = {
0b00000,
0b00000,
0b01010,
0b00000,
0b10001,
0b01110,
0b00000,
0b00000
};
byte frown[8] = {
0b00000,
0b00000,
0b01010,
0b00000,
0b01110,
0b10001,
0b00000,
0b00000
};
byte heart[8] = {
0b00000,
0b01010,
0b11111,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000
};
byte up[8] = {
B00000,
B00100,
B01110,
B11111,
B00100,
B00100,
B00000,
B00000
};
byte down[8] = {
B00000,
B00100,
B00100,
B11111,
B01110,
B00100,
B00000,
B00000
};
byte right[8] = {
B00000,
B00100,
B00110,
B11111,
B00110,
B00100,
B00000,
B00000
};
byte left[8] = {
B00000,
B00100,
B01100,
B11111,
B01100,
B00100,
B00000,
B00000
};
byte diag[8] = {
B00000,
B01111,
B00011,
B00101,
B01001,
B10000,
B00000,
B00000
};
void setup() {
lcd.createChar(6, smile);
lcd.createChar(7, frown);
lcd.createChar(8, heart);
lcd.createChar(1, up);
lcd.createChar(2, down);
lcd.createChar(3, right);
lcd.createChar(4, left);
lcd.createChar(5, diag);
lcd.begin(16, 2);
lcd.write(1);
lcd.write(2);
lcd.write(3);
lcd.write(4);
lcd.write(5);
lcd.write(6);
lcd.write(7);
lcd.write(8);
}
void loop() {}

PROGRAM 2
#include <LiquidCrystal.h>
LiquidCrystal lcd(36, 34, 32, 30, 28, 26);

const int buttonPin = 47;


int buttonState = 0;
bool scrolling = false;

void setup() {
lcd.begin(16, 2);
lcd.setCursor(1,0);
lcd.print("TEKNIK ELEKTRO");
lcd.setCursor(4, 1);
lcd.print("SV UGM");

pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
buttonState = digitalRead(buttonPin);

if (buttonState == LOW && !scrolling)


{
scrolling = true;

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


lcd.scrollDisplayLeft();
delay(300);
}
delay(1000);

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


lcd.scrollDisplayRight();
delay(300);
}
delay(1000);

scrolling = false;
}
}
PROGRAM 3
#include <LiquidCrystal.h>
LiquidCrystal lcd(36, 34, 32, 30, 28, 26);
int counter = 0;

void setup() {

lcd.begin(16, 2);
lcd.setCursor(5, 0);
lcd.print("Count: ");
lcd.setCursor(7, 1);
lcd.print(counter);
pinMode(47, INPUT_PULLUP);
pinMode(49, INPUT_PULLUP);
pinMode(51, INPUT_PULLUP);
}
void loop() {
int buttonA = digitalRead(47);
int buttonB = digitalRead(49);
int buttonC = digitalRead(51);

if (buttonA == LOW) {
counter++;
lcd.setCursor(7, 1);
lcd.print(" ");
lcd.setCursor(7, 1);
lcd.print(counter);
delay(300);
}

if (buttonB == LOW) {
counter--;
lcd.setCursor(7, 1);
lcd.print(" ");
lcd.setCursor(7, 1);
lcd.print(counter);
delay(300);
}

if (buttonC == LOW) {
counter=0;
lcd.setCursor(7, 1);
lcd.print(" ");
lcd.setCursor(7, 1);
lcd.print(counter);
delay(300);
}
}

You might also like