Can't get 20x4 i2c display working

The println in lcd.println("Starting up..."); is giving you those weird characters on the end. Change it to lcd.print("Starting up..."); to fix that problem.

And you don't need two lcd.Init() in your setup function, nor do you need to call lcd.backlight() in the loop function.

your the best :slight_smile:
thx.

Will leave the lcd.backlight() in there, because otherwise my startup... is without a lit display.

many tnx.

HazardsMind:
And you don't need two lcd.Init() in your setup function

It's a bad sign. If that's from the library example (and it was, when I saw the same thing) then it means that whoever wrote the library had trouble getting a reliable init, hence he stuck in hacks such as initing twice. It was when investigating hacks like these that I discovered common library bugs I described in my Amazon review linked above.

I had the same problem !

The chinese library is good.

In arduino software, there are 2 libraries locations, one on local folder, another in "My document/Arduino". In this last one, I found a LCD library, I deleted it and delete all LCD libraries on local folder, and installed manually LiquidCrystal_I2C2004V1_Chinese in local folder, renamed it "LiquidCrystal" and now it's good

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

uint8_t bell[8] = {0x4,0xe,0xe,0xe,0x1f,0x0,0x4};
uint8_t note[8] = {0x2,0x3,0x2,0xe,0x1e,0xc,0x0};
uint8_t clock[8] = {0x0,0xe,0x15,0x17,0x11,0xe,0x0};
uint8_t heart[8] = {0x0,0xa,0x1f,0x1f,0xe,0x4,0x0};
uint8_t duck[8] = {0x0,0xc,0x1d,0xf,0xf,0x6,0x0};
uint8_t check[8] = {0x0,0x1,0x3,0x16,0x1c,0x8,0x0};
uint8_t cross[8] = {0x0,0x1b,0xe,0x4,0xe,0x1b,0x0};
uint8_t retarrow[8] = { 0x1,0x1,0x5,0x9,0x1f,0x8,0x4};

LiquidCrystal_I2C lcd(0x20,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display

void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();

lcd.createChar(0, bell);
lcd.createChar(1, note);
lcd.createChar(2, clock);
lcd.createChar(3, heart);
lcd.createChar(4, duck);
lcd.createChar(5, check);
lcd.createChar(6, cross);
lcd.createChar(7, retarrow);
lcd.home();

lcd.print("Hello world...");
lcd.setCursor(0, 1);
lcd.print(" i ");
lcd.write(3);
lcd.print(" arduinos!");
delay(5000);
displayKeyCodes();
}

// display all keycodes
void displayKeyCodes(void) {
uint8_t i = 0;
while (1) {
lcd.clear();
lcd.print("Codes 0x"); lcd.print(i, HEX);
lcd.print("-0x"); lcd.print(i+16, HEX);
lcd.setCursor(0, 1);
for (int j=0; j<16; j++) {
lcd.write(i+j);
}
i+=16;

delay(4000);
}
}

void loop()
{

}

I user this code , but my display just have two line buut not thing in this, can any one help me please, thanks