Lcd doesn't show black rectangles

Hello!

I'm trying to connect a LCD (LMB162HBC) to my Arduino Mega 2560 following that scheme:

http://arduino.stackexchange.com/questions/2881/arduino-lcd-shows-only-black-boxes

I'm becoming crazy because when I connect the Arduino, the LCD shine...but all the screen is green, it doesn't show black rectangles...and I don't understand why. Also, when I charge the code, nothing appears in my screen.

//LiquidCrystal d(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

void setup() {                
     lcd.begin(16, 2);
     lcd.print("hello, world!");
}

void loop() {
     lcd.print("hello, world!");       
}

Which may be my problem?? I try to change all the connections but it it doesn't work already.

Thanks

Adjust the contrast pot. You need about 0.4V on the LCD contrast pin (pin #3 on most modules).

If you don't have a pot, just connect pin#3 to 0V. 0V should show some visible contrast.

David.

Thanks a lot David

Now I can see perfectly the black rectangles...

But I still have a problem...I compile the programe but no words appear...

Sorry, but I'm new in Arduino and in LCD, and I'm desperate.

Change your wiring. You are using 0, 1 for RS and E. These are the Serial pins.

Move RS, E to different pins. Let us know how you get on.

David.

I only see one line of black boxes... And I change the wiring and the response is the same like before.

It is a good idea to use wires in the same order as the LCD module. You are less likely to make mistakes. Your constructor needs the RW pin to be wired 0V.

I suggest that you use 7-argument constructor. The you can start with RS, E, RW ...DB4, DB5, DB6, DB7 e.g. connecting from digital#2 to digital#8. Your constructor would be lcd(2,3,4,5,6,7,8)

Everything depends on following a Tutorial religiously. I would always copy their particular example wiring first.

Afterwards, you can change the wiring to what suits you best.

David.

Remove the lcd.print statement from loop().

While troubleshooting LCD displays you really don’t want to be doing anything in loop(). There should be nothing between the brackets.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
  {
  lcd.begin(16, 2);                          // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  }

void loop()
  {
                                             // do nothing in 'loop'
  }

Don

I try to do all the things you suggest me...but I'm still seeing only a line of black boxes in the bottom of the screen.

I rewired all the pins

Have you connected the RW pin to 0V?

Show a photo of your wiring. Paste your actual sketch.

David.

but I'm still seeing only a line of black boxes in the [u]bottom[/u] of the screen.

While you're at it you should turn the display around (or stand on your head).

Don

I don’t even see a

#include <LiquidCrystal.h>

in the first post.

You are correct of course, but strictly speaking at that point he wasn’t complaining about not seeing text.

He should still have seen the boxes. You don’t even need a microprocessor for that part!

Don

Hello!

First of all, I want to say thanks all of you for your help. After our talking, I talked with my boss and we changed the LCD for another new one...and all worked perfectly. The problem was that the first LCD was broken for 1 and a half year, and we didn't know that. Thanks again!!

Maria