If it's a Hitachi HD44780 driver LCD (usually a 16 input LCD), pin 3 (not labeled as such, but pin 1 is labeled and pin 3 is 2 away) is your contrast setting.
What most LCD things advise you to do is get a potentiometer with one side to GND, and the other to +5V and connect the wiper to pin 3 (which is labeled Vo).
Besides potentiometer, you're also missing the lcd.begin(16,2) from your setup(). Use it before you use the lcd.
Some time ago floresta replied to a post about not having the lcd.begin puts the lcd on a 1/8 (?) duty cycle with different contrast than properly initialized 2 line lcds with 1/16(?) duty cycles. I googled and couldn't find it. That is another factor on the lcd contrast.
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
after setting it up according to the tutorial at addafruit
i'm sure all my connections are correct, the display works according to the program but it is very unclear even after adjusting the 10k pot..im not sure what the problem is please help me out..some extra info:
ive attached the LCD to the breadboard by means of soldering connector pins (not sure if this is the problem?)
the voltage out put between the middle pin and ground pin of the pot is 3.08v
I was able to get the first row showing before connecting the data pins but there was a thin line missing in the square blocks
vasudev:
the display works according to the program but it is very unclear even after adjusting the 10k pot..im not sure what the problem is please help me out..some extra info:
The first problem is that you are repeatedly writing to the LCD without any sort of delay to make what you have written readable. Try adding "delay(1000);" at the beginning or end of the loop() function.
If the display is still displaying the correct data but is unclear, then either your contrast pot is incorrectly set or you don't have the backlight connected. is the backlight working? btw some LCDs need a resistor in series with the backliight connection, others have it on the board already.
vasudev:
ive attached the LCD to the breadboard by means of soldering connector pins (not sure if this is the problem?)
See, you're getting the same answer from different people to the same problem you posted in different threads.
Don't hyjack other threads by posting your unrelated questions in multiple exsisting threads.
Hey thank you so much for the quick replies..i apologise for having posted else where..it was not my intention to disturb anybody else's thread..was not sure how this forum worked and will keep it mind for the future..
will try adding a delay in the program..@dc42: I think my back light is working fine, but not sure if it has an inbuilt resistor as the LCD module didn't come with a data sheet :(..but heres a link to the pic:
@dc42.. added a delay in the program it did make the display clearer but only hello was seen (the second half had white squares)..this happened for about 2mins then all i could see was the first row of white squares. the backlight is working fine tried adding a 220ohms and 110ohms resistance but it made the backlight flicker so i figured it worked better without the resistances..
@MAS32: I tried changing the speed hopefully that means the baud rate..but didnt help much..
now all i can see is a line of white squares in the first row..
PS: before i tried the above i set up the circuit again with only the power and the logic connected and this is what i saw (posting a pic)....is it possible that my LCD screen is faulty?...or should i try another value for the pot instead of the 10k...cause i noticed that when i plugged my arduino to the power adapter..it showed the second row slightly..but on the USB just the first row
pic of the initial setup..supposed to show the first row but if shows half the display instead:
(read from another post Floresta: " With the potentiometer at one end of it's range the display will be blank and at the other end you should see boxes on the top line of the display. If you do not get this behavior then it makes no sense to continue since no amount of programming will fix things.")
@MAS32: I tried changing the speed hopefully that means the baud rate..but didnt help much..
The speed i was talking about, is your refresh speed.
So how often you write to your screen per second.
This has nothing to do with baudrates, as you are not using serial to write to your LCD.
What i told you, is the same thing dc42 told you.
Post your new code so we can have a look at that.
In your last picture only power and contrast are connected.
The display doesn't get a reset (because there is no device connected that can send that) so it might act like this (but as you already read somewhere, the boxes are expected in the top row).
In your last picture only power and contrast are connected.
The display doesn't get a reset (because there is no device connected that can send that) so it might act like this (but as you already read somewhere, the boxes are expected in the top row).
What he is doing is part of the troubleshooting process. When you are troubleshooting a display problem you have to ascertain that it powers up properly and executes it's internal initialization steps without being confused by your code. To do this you leave off all of the signal lines and see what happens when you apply power.
If the display is operating properly it will perform the internal initialization routine which leaves it configured for a one-line display. This means that in the case of a 16x2 display only the top part will function, hence the expected single row of blocks.
In his case it is only the right half of the display that is functioning which indicates a different type of problem. The HD44780U type controller deals with the display of the characters on the left half of a 16x2 device while the display of the characters on the right half are handled by an 'auxiliary controller', typically an HD44100 or equivalent. In this case it looks like the auxiliary controller may be working but the main controller has a problem. This could be due to a poor connection between the glass display and the pc board which may be temporarily alleviated by pressing down on the black bezel that surrounds the display.