I have found several different pin-outs for LCD displays such as the one attached, which matches my display pin set (16 pins x 1 row). ESUMIC LCD Module Display for Arduino (Blue2004) link
In some, the K and A are connected, and in some they are not. K is GND (LED-) for back-light, and A is Vcc (LED+) for back-light.
One other observed difference is some have a 220 ohms between Vcc and A (LED+).
Is there any documentation on the correct connection showing why (why not) connect these and why (why not) add resistance to +5V?
The LCD itself has a 14-pin interface with a more or less standard interface originally introduced by Hitachi.
A lot of the early LCD modules had no backlight but most of those that did required a high voltage (more than 100v as I recall) to operate that backlight. The connections were at the end of the display.
Most modern LCD modules do incorporate an LED backlight and two pins are now typically added to the pc board design to provide an interface to that backlight. If a particular display does not have a backlight the same pc board can be used but those pins will be unused.
The pc board typically has provisions for a current limiting resistor but the display manufacturer may install a zero ohm resistor in which case the final circuit will require an external current limiting resistor.
So - there is no 'universal' documentation that will give you the answers to your questions. You need to use the documentation that matches your particular hardware. In the absence of such documentation you can usually follow the traces on your pc board to determine the answers.
OK, there are a lot of things to be done before you can adequately discuss matters about your immediate problem.
As was explained to you on your previous post, you need to go and read the forum instructions so that you can go back and modify your original post - the "More -> Modify" option below the right hand corner of your post - to mark up your code as such using the "</>" icon in the posting window. Just highlight each section of code or output from the IDE and click the icon. In fact, the IDE has a "copy for forum" link to put these markings on for you so you then just paste it here in a posting window.
Do not attach it as a ".ino" file. People can usually see the mistakes directly and do not want to have to actually load it in their own IDE. And that would also assume they are using a PC and have the IDE running on that PC.
But don't forget to use the "Auto-Format" (Ctrl-T) option first to make it easy to read. If you do not post it as "code", it can be quite garbled and is always more difficult to read.
In your case, you need to correct both of your posts.
Also, using that frequently faulty shield design, you need to check the first post in this "Displays" category.
@gyan9427 The hardware is fine, the problem is that when characters are sent from the Serial Monitor window then extra control characters are sent like "carraige return" and "line feed". As these are then piped to the LCD it plots these codes as a strange character.
You have two options:
Use the "No line ending" option in the Serial Monitor window
Filter out the control codes in your sketch
The control codes in this case will have a numerical value of <32, see the ASCII table here, so we can stop control characters getting to the LCD by using a while loop like this:
while (Serial.available() > 0)
{
byte c = Serial.read();
Serial.println(c); // Echo back the ASCII code received
if (c>=32) lcd.write(c);
}
You can delete the line that echos back the character code, it is there to show what is happening.
I'm surprised that the forum police didn't mention anything about the fact that he has hijacked this thread.
On the other hand, although he has also ignored the notice that this is an old thread, at least it shows that he did look back through the forum before posting. I'm kind of curious why he chose this particular thread to hijack.