I have connected an 16x2 HD44780 LCD to an Arduino Uno R3 using an I2C module with the PCF8574T chip on it.
I used the code and library from this page, and it worked ok: http://tronixlabs.com.au/news/tutorial-serial-i2c-backpack-for-hd44780compatible-lcd-modules-with-arduino/
Here's the code for convenience:
/*
Demonstration sketch for PCF8574T I2C LCD Backpack
http://tronixlabs.com/display/lcd/serial-i2c-backpack-for-hd44780-compatible-lcd-modules/
Uses library from https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
GNU General Public License, version 3 (GPL-3.0)
*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified backpack
void setup()
{
// activate LCD module
lcd.begin (16,2); // for 16 x 2 LCD module
lcd.setBacklightPin(3,POSITIVE);
lcd.setBacklight(HIGH);
}
void loop()
{
lcd.home (); // set cursor to 0,0
lcd.print(" tronixlabs.com");
lcd.setCursor (0,1); // go to start of 2nd line
lcd.print(millis());
delay(1000);
lcd.setBacklight(LOW); // Backlight off
delay(250);
lcd.setBacklight(HIGH); // Backlight on
delay(1000);
}
Next, I wanted to use the display with LCD Smartie, through the code found on this page: http://runawaybrainz.blogspot.ro/2013/12/arduino-lcd-smartie-oled-project.html
The code itself is attached as i2c_LCDSmartie_Project_V1_1.ino. I changed the address from 0x20 to 0x27. I ran LCD Smartie, setting the display plugin to matrix.dll and Startup Parameters to COM5,9600. The program does send data to the Arduino, but this only makes the LCD's backlight flicker. If I fidget with the Contrast and Brightness settings, I can sometimes see unintelligible characters on the board. The flickering is constant as long as LCD Smartie is set to scroll the text. With the scroll turned off, it either remains on or off, correlated loosely to the contrast and brightness slider positions. I also tried using crystal.dll with COM5,9600,2 and COM5,9600,1 respectively. The behavior is pretty much the same.
i2c_LCDSmartie_Project_V1_1.ino (13.9 KB)