You are on page 1of 3

LCD INTERFACING

Activity 1
WIRING DIAGRAM

m
er as
co
eH w
o.
DESCRIPTION rs e
ou urc
The activity was about a 16x2 LCD that displays a combination of
o

scrolling text and a timer. The first line of the LCD was supposed to scroll
aC s

from left to right and when it reaches a certain part of the text, will scroll
vi y re

from right to left. The second line of the LCD will display a timer.

BILL OF MATERIALS
ed d
ar stu

The components used in the experiment were the following:


Component Quantity
is

Arduino Uno R3 1
16 x 2 LCD 1
Th

250 kΩ 1
Potentiometer
220Ω resistor 1
sh

PROGRAM
Code:

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:23:35 GMT -05:00

https://www.coursehero.com/file/90444266/Laboratory-Report-Activity-1docx/
// include the library code:
#include <LiquidCrystal.h> if (iCursor == (iLenofText - 1) ) {
// initialize the library with the iCursor = 0;
numbers of the interface pins
}
lcd.setCursor(0,iLineNumber);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
char * Text = "Hello world! ";
if (iCursor < iLenofText - 16){
int iLineNumber = 0;
for (int iChar = iCursor; iChar <
int iCursor = 0; iCursor + 16 ; iChar++){
lcd.print(Text[iChar]);
void setup(){ }

m
er as
lcd.begin(16,2); }

co
eH w
} else {

o.
for (int iChar = iCursor; iChar <
rs e (iLenofText - 1) ; iChar++) {
ou urc
void loop(){
lcd.print(Text[iChar]);
UpdateLCDDisplay();
}
o

delay(1000);
aC s

for (int iChar = 0; iChar <= 16 -


lcd.setCursor(0,1);
vi y re

(iLenofText - iCursor); iChar++){


lcd.print("Timer: "); lcd.print(Text[iChar]);
lcd.print(millis() / 1000); }
ed d

}
ar stu

}
iCursor++;
void UpdateLCDDisplay(){ }
is

int iLenofText = strlen(Text);


Th
sh

Flowchart:

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:23:35 GMT -05:00

https://www.coursehero.com/file/90444266/Laboratory-Report-Activity-1docx/
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is

CONCLUSION
Th

We therefore conclude that there are different ways on displaying an


output in an LCD. This experiment also gave us an idea on how LCD works.
sh

How the output was dependent on the size of the LCD as well as the length
of text that was supposed to be the output.

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:23:35 GMT -05:00

https://www.coursehero.com/file/90444266/Laboratory-Report-Activity-1docx/
Powered by TCPDF (www.tcpdf.org)

You might also like