Go Down

Topic: LCD help (Read 3341 times) previous topic - next topic

tytower

Areyou sure you have the numbers right on the LCD ? not reversed

CaptainObvious

The diagram looks like it should work fine with the sketch you first provided.

But yeah.. I would check to make sure you don't have it hooked up backwards.  My two LCD's confuse me quite often as they have a different setup.

vampist

I did check the pins, they are labeled 1 and 16.
On the back of the LCD there is a simple diagram setup to show you what pin is which.

At this point I really think it's the LCD. Since they are rather cheap I may order two or three more.

http://www.adafruit.com/index.php?main_page=product_info&cPath=37&products_id=181

floresta

Don't forget to let us know the outcome.

Don

RichB

Hello again,

I played a bit more with compile, then upload.  upload definitely seems to compile first, followed by the upload.  no need to press 'compile/verify', then 'upload'.  Watch the subfolder using Windows Explorer and you can see the files being created.

well, now hello world is not working properly.  I can't get anything to show on lines 2 or 3 of my 4x20 display, and the boxes on rows 0 and 1, columns 8 thru 12, stay fully lit, like they are getting several characters at once.

I've tried pulling out each wire, one at a time, to see what a bad connection of each line would look like.  none of the wires will make this happen.  I'm wired up according to vampist's diagram.

I'm downloading a fresh copy of 0017.zip right now, I'll try again later with a pristine copy.

Rich.

tytower

Here are some of my lines running for my application . This may help out -especially the setup lines

lcd.begin(16,2);  for a 2line display-16,4 for a 4 liner?
 delay(500);
 lcd.clear();
 delay(1000);  
 lcd.print(F);
 lcd.setCursor(7,0);
 tempC=tempC*10;
 val=(int)tempC;
 lcdprintTenths(val);
 lcd.print("C");
 lcd.setCursor(13,0);
 lcd.print(reading0);
 lcd.setCursor(0,1);     // Next Row, Col then row , must start at 0,0
 lcd.print(L);
 lcd.setCursor(8,1);
 lcd.print(percent);
 lcd.print("%");
 lcd.setCursor(13,1);
 lcd.print(reading5);
 delay(4000);

RichB

Hello,

a pristine copy of 0017.zip did not help.

If I print to rows 0 and 1, and stay within about columns 0 to 7, then I don't get the fully lit up blocks in columns 8 to 13.

I copied and pasted the sample code, it had some undefined stuff.  I commented out the undefined code, and it showed me that staying within column 7 helps.

Rich.

Rich.

CaptainObvious

@Rich, I've gotten the same results, but only when I set the lcd.begin incorrectly.

Try using lcd.begin(20, 4);
or
lcd.begin(4, 20);  I can't recall which it is :)

Another thing to check is loose wires, if you have a semi-good connection, you can get some weird behaviors. Make sure if it's on a breadboard it's a solid connection:P

RichB

Hello,

I loaded the example, hello world, and changed lcd.begin to both 20,4 and 4,20, same result.  (I think it is supposed to be 20,4.)

I've wiggled every connection, pulled them out and put them back in.  wiggling doesn't seem to do anything, which I think is good.

Is there a ctrl-alt-del for the lcd display?  I feel like it need a good reboot to clear out previous uploads?  I've done the upload, and then pulled the usb plug, and then reinserted the usb plug, for a power up of the display, no change.

Rich.

tytower

#39
Nov 16, 2009, 03:25 am Last Edit: Nov 16, 2009, 03:27 am by tytower Reason: 1
You need to read a bit more.
Of course it is 20,4 and reading the references is where you get that info

My lines above were just to prompt you to look at your sketch and make sure you have the
begin()
clear()
print()
setCursor()

functions set as they should be .
The screen contains no information you need worry about .
When you reset your arduino it resets the screen with the clear() command

You have to tell the cursor where to go for each line and it prints your characters from there. If the string is too long you get all sorts of stuff.

Its like a blackboard- you tell it to start at 0,0 and then next line is 1,0 and so on.

Post the code you have now and we will check it

RichB

#40
Nov 16, 2009, 04:01 pm Last Edit: Nov 16, 2009, 07:17 pm by 1999-1200S Reason: 1
Hello,

I need to read lot's more!  This is neat stuff, and getting some experience is definitely needed.

For my code, I opened File, Examples, LiquidCrystal, HelloWorld and changed the begin from 16,2 to 20,4.  The example doesn't use clear().

It's possible that the example doesn't work right, because I may have damaged the LCD?

After I got hello world to work on saturday, I then loaded the Dallas Temperature Control library and One Wire.  

I've started a new topic with my questions on One Wire.
Thanks, Rich.

vampist

Well for anyone that is interested the new LCD came in today.
(contacted adafruit and they gave me a new one)

My jumper wires also came in a few days ago so setup was a snap.

I soldered the lcd pins, snapped it into a bread board. Programmed the arduino. Plugged in the wires.
aaaaaannnnnnnnnnddddddd

I get "hello, world!" Woohoo! :D

Thank you everyone for all your help with troubleshooting this problem.

Go Up