I2C LCD Display Problem (Only 16xSquares)

Hello,
I just bougth a 16x2 Display with sainsmart I2C adapter on the backside.
The original Library cant be used for this so i downloaded this one:
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
It is correctly shown in the Library Tab in the Arduino software.
I use a Arduino nano, where the I2C Pins are A4 and A5.
My connections are:
Vcc to 5V Arduino
Gnd to Gnc Arduino
SDA to A4
SDL to A5

If i turn the Arduino on, the displays backlight turn on and the first row of the display shows
16 Squares.
If i just try the Example in the Package (Tested other Packages already) it doesnt work.
I upload the sketch and nothing happens.... :frowning:
The display only shows the 16 squares.

What im doing wrong?
How i get Text to this Display!?

im getting crazy

I hope someone can help me with this.

Examplecode:

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



#define BACKLIGHT_PIN     13

LiquidCrystal_I2C lcd(0x38);  // Set the LCD I2C address

//LiquidCrystal_I2C lcd(0x38, BACKLIGHT_PIN, POSITIVE);  // Set the LCD I2C address


// Creat a set of new characters
const uint8_t charBitmap[][8] = {
   { 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
   { 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
   { 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
   { 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
   { 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
   { 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
   { 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
   { 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }
   
};

void setup()
{
   int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));

  // Switch on the backlight
  pinMode ( BACKLIGHT_PIN, OUTPUT );
  digitalWrite ( BACKLIGHT_PIN, HIGH );
  
  lcd.begin(16,2);               // initialize the lcd 

   for ( int i = 0; i < charBitmapSize; i++ )
   {
      lcd.createChar ( i, (uint8_t *)charBitmap[i] );
   }

  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()
{
   lcd.home ();
   // Do a little animation by writing to the same location
   for ( int i = 0; i < 2; i++ )
   {
      for ( int j = 0; j < 16; j++ )
      {
         lcd.print (char(random(7)));
      }
      lcd.setCursor ( 0, 1 );
   }
   delay (200);
}

The display only shows the 16 squares.

The second line of the display might be a lot further on in the LCD's memory map. Try printing a series of squares and see where the second row appears. It might be 20, 32, 40 or even 60, 64 spaces away from 0,0

i cant print anything.
only the backlight ist on... and the 16 squares
no matter what i upload nothing happens.
only 16 squares are shown.
and i dont want to show them...
i only want the hello world text there!

I am assuming that

lcd.print (" FORUM - fm   ");

Shows nothing.

i cant print anything.

Yes you can.

lcd.home ();                   // go home
  lcd.print("Hello, ARDUINO**1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&*() ");

Now see what appears on the second line.

i changed it like u told me and nothing happened.
this is what i had and what i have now too:

usually the example should work!?
i think im doing something wrong!?

why?
i just deleted the one with forum -fm
and replaced the other one with the code u wrote!?
what else u said to me?

sorry if i forgot something
im just getting crazy :frowning:

Do you know if your library have a function call "lcd.init();"?

yes this function is available

but is not written in the example

Try it anyways, it goes it setup(). Is the lcd 16x2? Try changing the address to 0x20 or 0x27.

omfg...

my adress was wrong.
its not 0x20 or sth like in the example.
its 0x3F

now the display does something but not very much...
it only turns backlight on and instant off
nothing more happens

Are you sure the library is designed for that display? If not, stop. Get the original library that didn't work and make it work. You are wasting your time if you have the wrong library.

i realy dont know, if it is the right library
i bougth this one:
http://www.ebay.de/itm/221038737474?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649#ht_3016wt_1139
The seller send an image to me where is a example code in it.
at the top of the code this is written:
//YWROBOT
So i downloaded a library for YWROBOT.
Changed the adress to 0x3F in the example code and
uploaded it.
with the code i can turn on the lcd backlight
but i cant write with this code!?

What u mean with " get the original library"?
the original arduino lib?

By original I meant the library coming from the manufacturer. Apprently that was not possible. The only link on the ebay page was broken. There are many I2C lcd backpacks and most of them differ in some details at the hardware level so using one display purchased from store A and library downloaded from store B is not going to help you. It also sounds wrong for the seller to profit from hardware and have another store support software. Please ask the seller to email you the library, which is a very small attachment. If they won't email you, you know you should stay away from them and their brand.

BTW, I don't know if sainsmart and ywrobot are related businesses so the seller could be scamming both businesses and you :slight_smile:

As humankind continues to socially devolve, the an isn't art of using the search function is lost in the mists of time......

:wink:

tack:
As humankind continues to socially devolve, the an isn't art of using the search function is lost in the mists of time......

http://arduino.cc/forum/index.php?topic=106655.0

:wink:

How can I find that topic? Clicking give me an error.

I have a pretty similar issue.
I soldered a ebay i2c adaptator with a PCF8574 to a noname 16x02 display. I did a serial check to get the port which is 0x27 (I was pretty sure reading the doc that it would be port 20). I installed pull up resistor. As I had only 10k I used a pair of them in parallel on sda and scl.
I have 16 full on letters on line 1 and line 2 is full off.
Rough start with i2c, I hope you help me find out!

loopingz:

tack:
As humankind continues to socially devolve, the an isn't art of using the search function is lost in the mists of time......

http://arduino.cc/forum/index.php?topic=106655.0

:wink:

How can I find that topic? Clicking give me an error.

not to worry, someone will come up with a snazzy saying about links being lost to the anals of time...... or is that annals....?

I did good progress with this link, should it work for someone... [SOLVED] Using I2C 16x2 LCD with Arduino - Displays - Arduino Forum

loopingz,
That thread has nothing do with this situation.
In the other thread the user has a LCD with a native i2c interface.
In this situation there is a standard hd44780 LCD that is using a PCF8574 based backpack.

These backpacks are not difficult to get up and running and there there are many threads on this.
If you search around you can find them.
I recommend using fm's library. However, some of the i2c examples shown are not very useful
as they are for his ElectroFun Xtra I/o backpack which won't work with any other backpack.
In order for it to work with your backpack, you will need to configure the library
for your backpack - which requires understanding how the PCF8574 chip is wired up to the HD44780.
If you don't know how it is wired up, then guessing is unlikely to get it working.
You will need to figure this out.
If you want to take the lazy way out, rather than figure it out,
you can find an i2clcdguesser sketch that will guess the needed constructor parameters.

--- bill