Interface for Dot-Matrix LCDs 0.8
⇒ back to Project Page

Module LCD ( 4-Bit interface to LCD)


This library provides functions for accessing a DOT-Matrix LCD with an ATMEL AVR Controller (ATmega). It supports displays with up to 4x20 characters and the HD44780 display controller or compatible (e.g. ST7066U).
Additionally, it provides functions for controlling (switch on/off, alternating) the display backlight.

The files lcd.c and lcd.h contain the interface functions and the respective definitions, the file port_definitions.h contains the required output pin configuration.

The following functions can be used directly:

The following codes gives an example for using the functions, starting with the initialization:

 lcd_pin_init();        //initialization of the display interface pins
 lcd_blpin_init();      //initialization of the backlight pin
 lcd_init();            //initialization of the display
 lcd_send_string("Hello World!", FALSE);  //prints the string "Hello World!"

If a string is initalized and located in the program memory (flash):

 const char pgm_mem_text[] PROGMEM = "Text 1234567890";

it can be sent to the display via:

 lcd_send_string(pgm_mem_text, TRUE);

The following two functions set the cursor to a specified position:

or back to the home position (0, 0):

Clearing the complete display and setting the cursor back to the home position:

 All Files Functions Variables Defines