090 PostLab3
090 PostLab3
IDE:
Introduction
LCDs (Liquid Crystal Displays) are used in embedded system applications for displaying various parameters
and status of the system.
LCD 16x2 is a 16-pin device that has 2 rows that can accommodate 16 characters each.
LCD 16x2 can be used in 4-bit mode or 8-bit mode.
It is also possible to create custom characters.
It has 8 data lines and 3 control lines that can be used for control purposes.
For more information about LCD 16x2 and how to use it, refer the topic LCD 16x2 module in the sensors and
modules section.
Marwadi University
Faculty of Engineering & Technology
Department of Information and Communication Technology
Subject: Foundation skills in
Aim: LCD Display Interfacing with Arduino UNO
sensor interfacing (01CT1103)
Experiment No: 03 Date: 31Aug’24 Enrollment No: 132261
To wire your LCD screen to your board, connect the following pins:
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 5
LCD D5 pin to digital pin 4
LCD D6 pin to digital pin 3
LCD D7 pin to digital pin 2
LCD R/W pin to GND
LCD VSS pin to GND
LCD VCC pin to 5V
Marwadi University
Faculty of Engineering & Technology
Department of Information and Communication Technology
Subject: Foundation skills in
Aim: LCD Display Interfacing with Arduino UNO
sensor interfacing (01CT1103)
Experiment No: 03 Date: 31Aug’24 Enrollment No: 132261
Arduino Code:
#include <LiquidCrystal.h>
void setup() {
lcd.begin(16, 2);
void loop() {
lcd.setCursor(0,0);
lcd.print("ICT");
lcd.setCursor(2,1);
lcd.print("Department");
Reference Material:
https://lastminuteengineers.com/arduino-1602-character-lcd-tutorial/
Marwadi University
Faculty of Engineering & Technology
Department of Information and Communication Technology
Subject: Foundation skills in
Aim: LCD Display Interfacing with Arduino UNO
sensor interfacing (01CT1103)
Experiment No: 03 Date: 31Aug’24 Enrollment No: 132261
//090-PostLab3-Code
// include the library code:
#include <LiquidCrystal.h>
byte Swastik[8] = {
0b00000,
0b10111,
0b10100,
Marwadi University
Faculty of Engineering & Technology
Department of Information and Communication Technology
Subject: Foundation skills in
Aim: LCD Display Interfacing with Arduino UNO
sensor interfacing (01CT1103)
Experiment No: 03 Date: 31Aug’24 Enrollment No: 132261
0b11111,
0b00101,
0b11101,
0b00000,
0b00000
};
byte Om[8] = {
0b00000,
0b00010,
0b11011,
0b01000,
0b11110,
0b01010,
0b11011,
0b00000
};
byte Tree[8] = {
0b00000,
0b01110,
0b11111,
0b11111,
0b01110,
0b00100,
0b01110,
0b00000
};
byte Android[8] = {
0b01010,
0b01110,
0b10001,
0b11011,
0b10001,
0b10001,
0b11111,
0b01010
};
byte Dumbbell[8] = {
0b00000,
0b00000,
0b10001,
0b11111,
0b10001,
0b00000,
Marwadi University
Faculty of Engineering & Technology
Department of Information and Communication Technology
Subject: Foundation skills in
Aim: LCD Display Interfacing with Arduino UNO
sensor interfacing (01CT1103)
Experiment No: 03 Date: 31Aug’24 Enrollment No: 132261
0b00000,
0b00000
};
byte Pyramid[8] = {
0b00000,
0b00000,
0b00000,
0b00100,
0b01110,
0b11111,
0b00000,
0b00000
};
byte Dollar[8] = {
0b00000,
0b00100,
0b01110,
0b01000,
0b00100,
0b00010,
0b01110,
0b00100
};
void setup()
{
// initialize LCD and set up the number of columns and rows:
lcd.begin(16, 2);
// Clears the LCD screen
lcd.clear();
// Print to the first row of the lcd.
lcd.print("CustomCharacters");
lcd.setCursor(2, 1);
lcd.write(byte(1));
lcd.setCursor(4, 1);
lcd.write(byte(2));
lcd.setCursor(6, 1);
lcd.write(byte(3));
lcd.setCursor(8, 1);
lcd.write(byte(4));
lcd.setCursor(10, 1);
lcd.write(byte(5));
lcd.setCursor(12, 1);
lcd.write(byte(6));
lcd.setCursor(14, 1);
lcd.write(byte(7));
}