16x1 LCD BUG

After frying =( a JHD162A, I bought a JHD161A, a 16x1 display.
But, even now I’m in dire straits.
The LCD lights up, but all I can see is the 1st 8 blocks darkened fully when initialized as 16x2.
Got the same result even when I initialized it as 8x2.
What’s wrong with it??
The display has only one IC blob.

LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

Please help.

The display has only one IC blob.

It's not a bug, it's a feature! Internally your 16x1 LCD is configured as an 8x2 so change your lcd.begin statement to reflect that fact. Follow the [u]LCD Addressing[/u] link at http://web.alfredstate.edu/weimandn to find out why this is the case.

Got the same result even when I initialized it as 8x2.

Then you have another problem. What did you do with LCD pin 5? Post your entire sketch and a photo if possible.

Also, it's not too good an idea to use digital pins 0 and 1 if you have others available.

Don

/*

The circuit:

  • LCD RS pin to digital pin 7
  • LCD Enable pin to digital pin 6
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)
  • LED+, LED- to +5V, GND

*/
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(8, 2);
// Print a message to the LCD.
lcd.print(“hellfire”);
}

void loop() {
// set the cursor to column 0, line 1
}

  • The code is good.
  • The LCD module is probably good since you get the darkened blocks.
  • That leaves a wiring or connection problem as the most likely reason for your display not working. You didn't respond to my question about LCD pin #5.

So we now need a photograph that clearly and unambiguously shows the connections between your Arduino and your LCD module.

Also: you should use the 'code' button (not the 'quote' button) when posting code.

Don

Also: you should use the 'code' button (not the 'quote' button) when posting code.

When copying from the IDE it adds the quote tags iso code tags (file edit menu) its a bug in the IDE

Well - a quote is better than nothing. Don

Pin 5 is grounded!

So we now need a photograph that clearly and unambiguously shows the connections between your Arduino and your LCD module.

Still waiting ...

Don

here are d pics.. * DSC01002.JPG (0 KB - downloaded 1 times.) * DSC01003.JPG (0 KB - downloaded 1 times.) * DSC01004.JPG (0 KB - downloaded 5 times.)

That's quite a compression technique that you are using. You managed to fit each picture into a file that is 0KB in size. Also, your keyboard seems to be messing up some letters when you type.

Don

sorry guys… i uploaded from my cell…

bt i hd gt d same prob even in my 16x2…
even d same thing when connected to 5v battery

http://arduino.cc/forum/index.php/topic,76783.0.html

DSC01002.JPG

DSC01003.JPG

DSC01004.JPG

bt i hd gt d same prob even in my 16x2.. even d same thing when connected to 5v battery

Please provide an English translation. Vowels and capital letters help.

Don-

So we now need a photograph that clearly and unambiguously shows the connections between your Arduino and your LCD module.

Where is the Arduino?

Don

Try the code where you write LiquidCrystal lcd(.......); the pin numbers without spaces like 2,3,4,5,6,7 I did this by accident when trouble shooting the same issue and it works now. It may be the LCD make or mistake in example code 'cos I use the same looking LCD that we see in all tutorials. And I needed to use contrast control with this LCD. By default (pin#3 open) it displays nothing. I used pot between pin#3 and pin#1 or tied it direct to GND

I did this by accident when trouble shooting the same issue and it works now.

You could stick your fingers in your ears and spin around three times. That should have the same effect as removing the spaces.

And I needed to use contrast control with this LCD. By default (pin#3 open) it displays nothing. I used pot between pin#3 and pin#1 or tied it direct to GND

This part is valid.

Don

floresta: You could stick your fingers in your ears and spin around three times. That should have the same effect as removing the spaces.Don

How many times a day you try this? You sound like bit of an expert on this. But you are right removing spaces has no effect. However nothing worked before, so maybe there was something else that got changed too. What it may be I have no clue. I used the same example and it did not work and then suddenly it did. I have experienced this many times with Arduino. Something that supposed to work does not and next time it does. So I shall try that finger in your ears trick next time I am in the similar spot. Sounds as good advise as any.

How many times a day you try this?

Not too often. I have been accused of having a different part of my anatomy in a different orifice.

You sound like bit of an expert on this.

I've been tinkering with these LCD modules for about 20 years with at least four processor families and almost exclusively in assembly language.

Dealing with these LCDs is really very interesting. Like so many other things they are really quite straightforward once you understand them but they seem really complex when you don't. What makes them more challenging is that in some respects they require you to meticulously follow the data sheet and in other respects they are quite tolerant of deviations.

What really messes people up is that the various clones of the original Hitachi design seem to be tolerant of different deviations. So experimenter 'A' comes up with some not exactly correct code that works with his LCD and passes on this 'working' code. Experimenter 'B', with a different brand LCD, tries it and when it doesn't work for him he comes up with another version of not exactly correct code that works with his LCD and passes that code on....

Sticking to the original Hitachi recommendations is the best bet, but those recommendations are sometimes hard to decipher due to translation and/or editorial errors.

Don

This is one of the very good advices I have got so far about LCDs. When I got my first LCD I could not get it to work precisely for these reasons. After the third one I have to agree with all you say.

Sorry guys for the delay…
Here are the pics of the arduino

DSC01016.JPG

DSC01017.JPG

DSC01019.JPG

DSC01020.JPG