My first Arduino kit arrived a few days ago. I've had experience before with simulators, so I was easily able to get started with LED setups and servos. However, the LCD has stumped me.
Whenever I power my arduino, the LCD displays scrambled text inside white boxes (1st picture in the attached document)
Your photo shows the backlight. So the backlight LED must have cathode on pin#15 and anode on pin#16. Most 16x2 have anode (A) on pin#15 and cathode (K) on pin#16. It is not uncommon to have swapped A, K.
Please check you wires. Post a clear photo as JPG, PNG, ... not a PDF.
I think that's just because you have been uploading the sketch or pressing reset several times, and the text appears in different places each time, because your code does not set the cursor position before printing the text.
I've checked the pins and A is before K, plus I tried switching the wires and that only dimmed the LCD so it isn't that.
I've swapped the wires of pin 7 and 10 on the breadboard the LCD is connected to as well as their positions in the code so the parameters for the LCD class now read "(12, 11, 9, 8, 10, 7)". The screen still displays white boxes, but "Hello World" now displays only once.
EDIT: I've put a 2k ohm resistor on V0 to help set the contrast, the message now displays clearly. Thank you all for your advice.
You are right - a PDF is indeed "A very unconventional method of posting pictures to the Arduino forums". It is inconvenient to view, particularly on tablets/ phones (as some people actually use here!) and cannot be embedded in the thread.
OK, I am really wondering what the 9 V "PP3" battery is doing - it would be a rather short-lived means of powering an Arduino.
It would seem that however you have the backlight connected, it is working. Swapping the connections should not allow it to light up at all, though the text will still be visible in good light. In general, given that resistor "R8" on the LCD board is "101", that is 100 Ohms, you do not actually need the 220 Ohm series resistor except to dim the backlight.
A resistor from Vo to ground is the correct means of setting the contrast. There should be no connection to Vcc. 5 V - showing a potentiometer connected to ground and Vcc is a longstanding blunder perpetuated by people who just do not understand how the LCD actually works. You do need to adjust the resistor value for best contrast, 470 Ohms or less is likely to be good.
zenith5720:
My first Arduino kit arrived a few days ago. I've had experience before with simulators, so I was easily able to get started with LED setups and servos. However, the LCD has stumped me.
Ah! So your previous discussion thread was in regard to a simulation. (As you revealed in your third posting. OK. )
It happens from time to time here that helpers spend substantial time attempting to resolve an intractable problem only to (hopefully) realise the problem described was in fact, not real!