User:Jaswinder530/sandbox

Lab 6: LCD

CPE185 Lab Section # 2

Sean Kennedy

Lab Day: Tuesday

Lab Time: 6:30pm

Singh, Jaswinder

Introduction: In this lab we are going to connect LCD with Raspberry pi and Display Hello World on it. LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.

Procedure:

1.      Connecting Raspberry pi with LCD

In figure 1 you can see the circuit of the LCD connected with the Raspberry Pi

2.      Installing Wiring

Figure 2 Steps to install wiring

In Figure 2 you can see steps to install the wiring of the circuit.

3.      Code

(The Code bellow is the C code for 4 bit circuit to display Hello World)


 * 1) include 


 * 1) include 

//USE WIRINGPI PIN NUMBERS


 * 1) define LCD_RS  25               //Register select pin


 * 1) define LCD_E   24               //Enable Pin


 * 1) define LCD_D4 23               //Data pin 4


 * 1) define LCD_D5 22               //Data pin 5


 * 1) define LCD_D6 21               //Data pin 6


 * 1) define LCD_D7 14               //Data pin 7

int main

{

int lcd;

wiringPiSetup;

lcd = lcdInit (2, 16, 4, LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7, 0, 0, 0, 0);

lcdPuts(lcd, "Hello, world!");

}

4.      Everything working

Figure 3 Hello World on LCD with Raspberry pi

In figure 3 you can see “Hello World” Displaying on LCD with Raspberry pi

Conclusion: This lab was pretty was easy all I all have to connect the circuit install the wiring and run the code and I got everything to work.