I know quite a few people have had the same problem but I haven't found a solution yet. Whenever I upload a sketch to my LCD the result is always just black boxes.
My setup and code I found from the Hacktronics site.
Does anyone know if I need to do something to initialize the LCD or is it most likely a wiring problem?
I know quite a few people have had the same problem ...
That would be an understatement.
... but I haven't found a solution yet.
You couldn't have tried very hard although the search box at the upper right is barely better than useless.
Try your search at google with something like this: LCD "black boxes" site:arduino.cc
Whenever I upload a sketch to my LCD the result is always just black boxes.
I see that you are using a 16x1 display. This makes the troubleshooting different, so the search I mentioned before may not help too much (sorry about that).
Does your display have one chip (or epoxy blob) on the back or does it have two?
Do you have black boxes in all 16 positions or only in 8 of them?
In your sketch why are you trying to write to the second line of a one line display?
The display in your photograph does not match up with any of the DEM16101datasheets (such as the one in reply #3) that I have found.
The DEM16101 has it's terminals at the upper left of the pc board whereas your terminals are at the lower left.
Many (most?) of the displays with their terminals at the lower left use a non-standard pinout. It looks like I can see the number 16 printed on your display but that does not necessarily mean that pin 1 is at the other end. Some of those non standard pinouts actually go 14, 13, 12 .... 2, 1, 15, 16.
Also - once you get the pinout figured out you have to deal with the fact that a 'single blob' 16x1 display is configured as an 8x2. Positions 1-8 are on line 1 and 9-16 are on line 2.
You may very well find out that once you get your pin positions figured out that the display works properly.
A workable (but untested) sketch would then look something like this:
#include <LiquidCrystal.h>
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // put your pin numbers here
void setup()
{
lcd.begin(8, 2); // this is what you need for a single chip 16x1
lcd.print("hello, w"); // display the left half of the screen
lcd.setCursor(0,1) // this should put you at the center
lcd.print("orld!"); // display the right half of the screen
}
void loop()
{
}
Note that the 'R/W' pin is not listed in the constructor, make sure that you connect pin 5 of the LCD to GND.