How hard can it be to make an lcd work? HARD!

Hi there

Seriously! I really hunted the answer for my troubles with a display for my Arduino. I know for a fact that it's blue, backlid and has four lines of each 20 characters. But...
I've identified the added chip as an I2C and wired the pins according to various online sources. Should be correct.
I've attached pictures of wires, chip and sketch/errors.
When I treat it like 2x16 characters I get a blank blue screen.
When I treat it like 4x20 characters I get a black screen as the light turns off.
I neither case I get any letters, symbols or anything of the like.
Help would really be appreciated here, thanks!

Kind regards,
Chris

Unable to attach images

http://postimg.org/image/f7p0vuxk5/
http://postimg.org/image/ftkigdvu9/
http://postimg.org/image/saf05nip7/

http://tronixlabs.com/news/tutorial-serial-i2c-backpack-for-hd44780compatible-lcd-modules-with-arduino/

The above link has all the information you will need to get up and running.

Not sure what lcd.init is meant to do. But I might recommend lcd.begin(20, 4);

Hi

Thanks for your swift and kind reply.
I follow the link and the instructions. All I change i 16,2 to 20,4. Now the screen flickers and I get a ton of error messages.
The chip looks exactly the same on http://tronixlabs.com/ and my display.
What to do?

Kind regards,
Chris

cveng:
I follow the link and the instructions. All I change i 16,2 to 20,4. Now the screen flickers and I get a ton of error messages.

It is almost impossible to help when you don’t post your code. And please post your program using the code button </>

so it looks like this

Also post the error messages.

The first message usually tells you what is the main problem.

…R

What errors? Error messages do actually mean something; whenever asking for help on any technical matter, if you’ve received error messages, you should post the full text of any and all error messages received. The IDE even has a little button to copy the errors to the clipboard.

Please also put the code in your post, using code tags (the button in upper left that looks like </> ).

Robin2:
It is almost impossible to help when you don’t post your code. And please post your program using the code button </>

Also post the error messages.

The fist message usually tells you what is the main problem.

…R

Well I’ll have a try…

/*
Demonstration sketch for PCF8574T I2C LCD Backpack
http://tronixlabs.com/display/lcd/serial-i2c-backpack-for-hd44780-compatible-lcd-modules/
Uses library from https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
GNU General Public License, version 3 (GPL-3.0)
*/

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

LiquidCrystal_I2C  lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified backpack

void setup()
{
  // activate LCD module
  lcd.begin (20,4); // for 16 x 2 LCD module
  lcd.setBacklightPin(3,POSITIVE);
  lcd.setBacklight(HIGH);
}

void loop()
{
  lcd.home (); // set cursor to 0,0
  lcd.print(" tronixlabs.com"); 
  lcd.setCursor (0,1);        // go to start of 2nd line
  lcd.print(millis());
  delay(1000);
  lcd.setBacklight(LOW);      // Backlight off
  delay(250);
  lcd.setBacklight(HIGH);     // Backlight on
  delay(1000);
}

Hope all is shown

error message.txt (45.9 KB)

You're trying to use two LCD libraries, LCD and LiquidCrystal_I2C.

These two libraries look to be (almost) identical, and use the same names for their functions, resulting in the multiple definition errors.

Use only one of the two libraries.

Well, I just copy/pasted the code from the link in reply #2, as I suppose Tronixlabs know, what they’re doing. All I changed was the 16,2.
Commenting out the #include <LCD.h> changes nothing except the rate of which the screen now flickers. Looks like maybe 1/3 the speed.
Did an I2C scan, and I’m sure the address is 0x27.

Chris

Most probably, do not have the correct constructor for your module.

LiquidCrystal_I2C  lcd(0x27,2,1,0,4,5,6,7);

You can determine the proper one by running the sketch by Bill Perry called "i2cLCDguesser". You can find more information on it here http://forum.arduino.cc/index.php?topic=196991.msg1455558#msg1455558

In actuality there are only a few possibilities. There are shown below.

// EN, RW, RS, D4, D5, D6, D7, BL, POL
  { 2,  1,  0,  4,  5,  6,  7,  3, POSITIVE }, // YwRobot/DFRobot/SainSmart
  { 2,  1,  0,  4,  5,  6,  7,  3, NEGATIVE }, // Robot Arduino LCM1602/2004
  { 4,  5,  6,  0,  1,  2,  3,  7, NEGATIVE }, // MJKDZ board
  { 6,  5,  4,  0,  1,  2,  3,  7, NEGATIVE }, // I2CIO board modded for backlight (pnp transistor)
  { 6,  5,  4,  0,  1,  2,  3,  7, POSITIVE }, // I2CIO board modded for backlight (npn transistor)
  { 4,  5,  6,  0,  1,  2,  3,  7, POSITIVE }, // (extra combination of MJKDZ just in case...)

In your original sketch, you had the line:

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD addr to 0x27 for a 20 chars and 4 lines

You were using a command that you though was to set-up the number of characters and lines on the display.

Whereas the Tronixlabs sketch has the following line, using the same command, but in a different way.:

LiquidCrystal_I2C  lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified backpack

It looks to me as though this command is being used in the Tronixlabs sketch to allocate which pins on the native LCD module are used for the various signals that control the LCDs operation.
Maybe this line needs modifying to suit your own particular LCD module?

DrAzzy:
You're trying to use two LCD libraries, LCD and LiquidCrystal_I2C.

These two libraries look to be (almost) identical, and use the same names for their functions, resulting in the multiple definition errors.

Use only one of the two libraries.

Errrrr... he does in fact need both libraries.

As cattledog says, a crucial step is to verify what constructor is needed - will save u a lot of hair.

Hi,
Can you post a picture of the front of your LCD display?
Where did you buy the display?
Was the I2C already fitted when you got it?

Tom.... :slight_smile:

Hi
Check this thread.

In the top right hand corner of this screen is a search facility, try LCD I2C

Tom... :slight_smile:

Hi again

Thanks for all your kind replies - your's too, Tom. It arrived just as I solved the issues.
As #9 suggested, I tried the i2cLCDguesser. It worked and I corrected some numbers. Now everything works fine! :slight_smile:
A bonus question: Is Æ Ø Å (Danish letters) possible?

Kind regards,
Chris

Hi,
Can you post your working sketch so if anyone else has these problems, it will help.

I'm not sure about those characters, the LCD chip datasheet will have a list of characters, but I'm not sure how to implement them over I2C.

You can make custom characters but I haven't looked at a data sheet for the LCD in ages.

Tom.... :slight_smile:

cveng:
A bonus question: Is Æ Ø Å (Danish letters) possible?

As was answered when this exact question was last asked, unless you happen to find some in the datasheet,

you can add just eight yourself using the programmable character generator locations.