I bought an 8x2 LCD on ebay. It has 14 pins. My understanding is that on a standard i2C "backpack" the 15th and 16th pins are for the backlight. I wired the pins in order.
My 8x2 LCD has pins in this order:
14 13
12 11
10 9
8 7
6 5
4 3
2 1
So, I had to criss-cross the wires:
It almost works. I'm using this code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 8 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 8, 2);
void setup() {
// initialize the LCD
lcd.begin();
// Turn on the blacklight and print a message.
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Phone!");
}
void loop() {
//do nothing
}
This code works fine for 20x4 and 16x2 displays.
But with the 8x2 I get this result:
(I did an i2C scan and 0x27 is the correct address. So, that's not the issue. )
I did an i2C scan and 0x27 is the correct address. So, that's not the issue.
That's not the only issue. You also have to deal with the interconnections between the chip on the I2C adapter and its external pins that go to the display, For this you need the I2C guesser sketch and this in turn requires the use of FM's 'New Liquid Crystal Library' which is currently the best one around.
Use the search box at the upper right and look for I2C LCD. You will quickly find links to the library and the I2C guesser sketch.
Why is only one line showing?
This is the typical display that you get when the LCD controller is not properly initialized. This will happen if you are using a library that is incompatible with your adapter among other causes.
I used a standard I2C backpack on an 8x2 LCM0802C display. My display had the pins on the top of the display, with the silkscreen to tell me what the pins were. I used a schematic for the typical I2C display backpack and connected a ribbon between them.
If you can find the pin out of your LCD you should be able to do the same. I init mine with exactly the same line as you used "LiquidCrystal_I2C lcd(0x27, 8, 2);".
I had the same screen and same problem as the OP. After reading wabbitguy's blog post and this thread, I still couldn't get it working. I ended up noticing that the back of the screen on the left side (opposite of the 14 pins) were RA and RK terminals. I soldered pins onto these and hooked them up to the remaining two pins on the I2C board and boom, it worked.
I ended up using "LiquidCrystal_I2C lcd(0x3f, 8, 2);" and it worked.