This was a question, but I have figured it out from some great people here, so here It a quick tutorial showing you how to do it.
===> 1, Go download the I2c LCD library: https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
===>2, unzip: LiquidCrystal_V1.2.1.zip; delete or move the original LiquidCrystal and all other lcd library you got
===>3, run the helloWorld_i2c example. if it works, you are good to go, but most likely it won't work.
reason it won't work:
A, wire connection is incorrect. for my Uno , connections are (sda - A4) (scl - A5);
B, incorrect address; All I2C device have an address from 8-127 something; mine is 0x27;
C, incorrect pins layout, you need to remap your pin. mine is lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
===>4, find your device address using this sketch while opening your serial Monitor : Arduino Playground - I2cScanner
it should come up like this:
Scanning...
I2C device found at address 0x27 !
done
===>5, find the pin layout: download i2cLCDguesser; open it with notpad; it's just an arduino sketch. from your serial Monitor. you should get something like this:
- Guess constructor for i2c LCD backpack
----------------------------------------------------------------
NOTE/WARNING: Guessing the i2c constructor is not really a
good thing since it could damage the hardware. Use with caution!
Do not leave things with an incorrect guess for too long.
i.e. advance to the next guess as soon as possible
when the guess in incorrect.
If the guess is correct, the constructor will show up
on the LCD.
----------------------------------------------------------------
<Press <ENTER> or click [Send] to Continue>
Scanning i2c bus for devices..
i2c device found at address 0x27
Device found: PCF8574
<Press <ENTER> or click [Send] to start guessing>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
<Press <ENTER> or click [Send] to Continue>
===>6, open that helloWorld_i2c example,
change
LiquidCrystal_I2C lcd(0x38); // Set the LCD I2C address
to (your result)
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
===> Done!!! It will work!!!!
i2cLCDguesser.zip (4.3 KB)