Pages: [1] 2   Go Down
Author Topic: I2C LCD Display Problem (Only 16xSquares)  (Read 1750 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.... smiley-sad
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:
Code:
#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);
}
« Last Edit: February 03, 2013, 06:25:28 pm by cthulhu666 » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 598
Posts: 33339
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 598
Posts: 33339
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am assuming that
Code:
lcd.print (" FORUM - fm   ");
Shows nothing.

Quote
i cant print anything.
Yes you can.
Code:
lcd.home ();                   // go home
  lcd.print("Hello, ARDUINO**1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&*() "); 
Now see what appears on the second line.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3414
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes this function is available

but is not written in the example
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3414
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try it anyways, it goes it setup(). Is the lcd 16x2? Try changing the address to 0x20 or 0x27.
« Last Edit: February 03, 2013, 07:25:40 pm by HazardsMind » Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged


UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

;-)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

;-)

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

Pages: [1] 2   Go Up
Jump to: