4 bit LCD library and Hitachi HD44780 compatible display

As floresta says, leaving the RW pin floating is asking for trouble. You need to connect it to ground.