I2CLCD
HD4470 LCD driver via I2C interface
 All Functions Groups Pages
I2CLCD Documentation
i2clcd.h - LCD over I2C library
Designed for HD44870 based LCDs with I2C expander PCF8574X on Atmels AVR MCUs
Author
Nico Eichelmann, Thomas Eichelmann, Falk Brunner
Version
0.12
License:
GNU Lesser General Public License
Files:
i2clcd.h
i2clcd.c
Note
Requires I2C-Library from Peter Fleury http://jump.to/fleury
Only testet with the following configuration:
2x16 Display (Displaytec 162), PCF8574P, ATmega8 @ 8 Mhz
4x20 Display (TC2004A-01T), PCF8574P, ATmega8 @ 8 Mhz
AVR-Studio 4.18, WinAVR20100110 (avr-gcc 4.3.3)
PIN-Assignment:
 Pin assignment is completely free configurable, just set the defines for LCD_D0 ... accordingly
 Example assignment, working with 
 PCF8574    <->     LCD
 ----------------------------------------------
 P0     <->     RS
 P1     <->     RW
 P2     <->     E
 P3     <->     LIGHT
 P4     <->     DB4
 P5     <->     DB5
 P6     <->     DB6
 P7     <->     DB7 
Example:
#include <stdbool.h>
#include <stdint.h>
#include <avr/pgmspace.h>
#include "main.h"
#include <util/delay.h>
#include "i2clcd.h"
#include "i2cmaster.h"
const char string_flash[] PROGMEM = "Hello Flash!";
int main(void)
{
char string1[] = "Hello World!";
i2c_init();
lcd_light(true);
lcd_print(string1);
lcd_print_P(PSTR("I2CLCD V0.12"));
// always set all three parameters (OM/OFF) when using this command
_delay_ms(1000);
_delay_ms(2);
lcd_print_P(string_flash);
lcd_printlc_P(2, 2, string_flash);
//- Endless loop
while (1) {
}
}