Go Down

Topic: I2C LCD Display Problem (Only 16xSquares) (Read 4816 times) previous topic - next topic


Feb 04, 2013, 12:16 am Last Edit: Feb 04, 2013, 12:25 am by cthulhu666 Reason: 1
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:
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.... :(
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.

Code: [Select]
#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
  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
Code: [Select]
lcd.print (" FORUM - fm   ");
Shows nothing.

i cant print anything.

Yes you can.
Code: [Select]

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!?


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 :(


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


yes this function is available

but is not written in the example


Feb 04, 2013, 01:19 am Last Edit: Feb 04, 2013, 01:25 am by HazardsMind Reason: 1
Try it anyways, it goes it setup(). Is the lcd 16x2? Try changing the address to 0x20 or 0x27.
My GitHub:



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.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


i realy dont know, if it is the right library
i bougth this one:
The seller send an image to me where is a example code in it.
at the top of the code this is written:
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 :)
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


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




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



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!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131