user34288: I've tried this code on an LCD, and instead of displaying "Hello World!" it displays what is shown on the picture.
Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);
}

void loop() {
  lcd.print("Hello World!");
  delay(500);
  lcd.clear();
  delay(500);
}



user11548: Try the following

Double-check the LCD soldering 
Double-check your wiring
Ensure that the pins you are using for your LCD are not assigned to some other function. This caused jumbled, random characters here.


user34324: From the attached I can see that you are connecting D7 to digital 2 of arduino. And I assume the pins D6 D5 D4 are also connected to 3, 4, 5 pins respectively, which is correct for your code.
But make sure the R/W pin is connected to proper ground. Verify that by measuring voltage if possible.
Also serial print whatever you are giving the lcd  to make sure it is not an encoding issue.

34288: <p>I've tried this code on an LCD, and instead of displaying "Hello World!" it displays what is shown on the picture.</p>

<p>Code:</p>

<pre><code>#include &lt;LiquidCrystal.h&gt;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);
}

void loop() {
  lcd.print("Hello World!");
  delay(500);
  lcd.clear();
  delay(500);
}
</code></pre>

<p><a href="https://i.stack.imgur.com/IWWGp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IWWGp.jpg" alt="Photo of LCD displaying corrupted text"></a></p>
 11548: <p>Try the following</p>

<ol>
<li>Double-check the LCD soldering </li>
<li><p>Double-check your wiring</p></li>
<li><p>Ensure that the pins you are using for your LCD are not assigned to some other function. This caused jumbled, random characters <a href="http://forum.arduino.cc/index.php?topic=227433.0" rel="nofollow noreferrer">here</a>.</p></li>
</ol>
 34324: <p>From the attached I can see that you are connecting D7 to digital 2 of arduino. And I assume the pins D6 D5 D4 are also connected to 3, 4, 5 pins respectively, which is correct for your code.
But make sure the R/W pin is connected to proper ground. Verify that by measuring voltage if possible.
Also serial print whatever you are giving the lcd  to make sure it is not an encoding issue.</p>
