Want to take admission? Contact us! • Find us on Google Map

16×2 LCD display connection details with ATMega8 microcontroller

11-12th Bifocal Electronics Notes

Vidyasagar Academy, Akola is a trusted name in the field of education. If you liked our free downloads, please write Google Review about us or follow us on Google+.

You can use 16×2 LCD display in your microcontroller kit by using these connections. Once the hardware connections are done properly, as shown below, don’t forget to include the “lcd.h” and “lcd.c” files in your source code, as follows:

The code for displaying the characters on the LCD display is also given below.

...
include "lcd.h" // file to drive the LCD display properly
include "lcd.c" // the C file for the LCD display
...
...
...
void main()
{
//Initialize the LCD Module
LCDInit(LS_NONE);
	
LCDClear();
LCDWriteString("16 character message");
LCDWriteStringXY(0,1,"16 character message");
_delay_ms(2500);
LCDClear();
...
...
...
while(1)
{
LCDWriteIntXY(0,0,variable_value_to_display,4);
LCDWriteString(" unit_if_any");
_delay_ms(500);
....
....
....
}
}
16x2 LCD display connection details with ATMega8 microcontroller

Detailed connection diagram of 16×2 LCD display with ATMega8

You can download these two files from following links:

Comments on this entry are closed.