I'm at wit's end....
Using IDE 1.0.5. Arduino Uno R3
This is the device: http://www.amazon.com/gp/product/B00AE0FRDQ/ref=oh_details_o08_s00_i00?ie=UTF8&psc=1
However, the picture of the backpack isn't exactly the same. Mine has LCD2004 printed on the board.
The I2C expander is a PCF8574. Data sheet here: http://www.nxp.com/documents/data_sheet/PCF8574.pdf
This is the driver: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
This is the code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
void setup()
{
lcd.begin(20,4); // initialize the lcd
lcd.home (); // go home
lcd.print("Hello, ARDUINO ");
lcd.setCursor ( 0, 1 ); // go to the next line
lcd.print (" FORUM - fm ");
delay ( 1000 );
}
void loop()
{
}
The pin assignment were verified with an ohmmeter (except for the backlight pin).
Display works fine after uploading code. After a power cycle it displays blocks on lines 1 and 3.
I've tried several drivers. The one listed above and this one: http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/ work similarly although I'm not sure how to control the backlight with the new liquid crystal driver.
The LCD is the only device connected. 5V to Vcc, Gnd to Gnd, A4 to SDA, A5 to SCL.
I have read numerous threads in this forum and they seem to point to driver issues.
http://forum.arduino.cc/index.php?topic=176457.0
http://forum.arduino.cc/index.php?topic=174860.0
http://forum.arduino.cc/index.php?topic=158312.0
http://forum.arduino.cc/index.php?topic=138674.0
The information here: http://web.alfredstate.edu/weimandn/lcd/lcd_initialization/lcd_initialization_index.html seems to describe my problem.....
Most of the people reading this are probably tinkering with an LCD module that is connected to a microcontroller and is powered by the same power supply that is powering the microcontroller. Let's assume the best case, where the power supply does satisfy the requirements for an internal reset of the LCD controller, and where the program in the microcontroller doesn't attempt to send any information to the LCD module until that internal reset is finshed. What happens when the the reset button on the microcontroller is pushed? Answer: The program code will run again, but the LCD module will not be re-initialized since it's power was never interrupted. Here's the problem: The program code contains a Function Set instruction, and this instruction should only be executed once, immediately after the LCD module is initialized. Well it already ran once, when the power was applied, and here it is running it again, after the reset button is pushed and the microcomputer code restarts. When this instruction is executed a second time the status of the LCD controller may be indeterminate or, in plain language, the LCD controller may stop responding.
Any help appreciated...