Retrolefty - Thank you I'll correct the comment. I don't know what a "floating input" is.
BillHo - I tried connecting it to pin 4 (register select) and pin 5 (read/write)
Base on the Syntax of the LiquidCrystal() function,
LiquidCrystal(rs, enable, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)
LiquidCrystal(rs, enable, d0, d1, d2, d3, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(31, 35, 39, 43, 47, 51);
You have Pin31 connected to rs pin 4 of LCD, why you connect pin 4 to LCD again?
The R/W pin 5 of LCD was connected to GND because you do not need to read back from the LCD.
Where is this R/W pin 5 of LCD connected to? what for?
"floating input" -- if you read a input pin that not connected to anything, which call floating.