16x2 display not displaying text only white boxes on top row

Not all LCD are created equal, I would get a variable resistor and try it. One leg to GND, other leg to 5v, and middle leg (wiper) to pin 3 of the LCD and play around it a bit. It is possible you can't see the text because the contrast is too high causing all blocks to be visible.