Go Down

Topic: 16x1 LCD BUG (Read 2 times) previous topic - next topic

hca6194

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.

Quote

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


Please help.

floresta

#1
Oct 30, 2011, 03:28 pm Last Edit: Oct 30, 2011, 03:33 pm by floresta Reason: 1
Quote
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 LCD Addressing link at http://web.alfredstate.edu/weimandn to find out why this is the case.

Quote
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

hca6194

Quote

/*

  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
}


floresta


  • 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


robtillaart

#4
Oct 30, 2011, 07:09 pm Last Edit: Oct 30, 2011, 07:11 pm by robtillaart Reason: 1
Quote
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
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

floresta

Well - a quote is better than nothing.
Don

hca6194


floresta

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


Still waiting ...

Don

floresta

#8
Nov 01, 2011, 03:05 pm Last Edit: Nov 01, 2011, 03:08 pm by floresta Reason: 1
Quote
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

hca6194

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

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


floresta

#10
Nov 02, 2011, 04:26 am Last Edit: Nov 02, 2011, 04:31 am by floresta Reason: 1
Quote
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-

floresta

Quote
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

vanakaru

#12
Nov 02, 2011, 08:25 pm Last Edit: Nov 02, 2011, 08:47 pm by vanakaru Reason: 1
Try the code where you write
Code: [Select]
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

floresta

#13
Nov 02, 2011, 10:46 pm Last Edit: Nov 02, 2011, 10:48 pm by floresta Reason: 1
Quote
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.

Quote

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

vanakaru


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.

Go Up