I am using a Sainsmart LCD2004 I2C display and the hd44780 library as suggested elsewhere on this forum. The display is connected to an Arduino UNO. I am using 4.7Kohm pull ups for SDA and SCL. Using the library's diagnostic, I get a good compile and upload to Arduino. The display flashes a few times and finally says something like: "LCD 0: 0x27". That's fine because there is only one I2C device and its address is 0x27. So I figured I was communicating with the display and it was working properly. Not only that but the library figured out which address was needed and which Arduino pins it was connected to (A4 & A5).
Next step. I used hd44780 library's "Hello World". Compiled fine and uploaded. Nothing on the display and the Arduino diagnostic LED is flashing 4 times. When I looked up error code 4 in hd44780.h I find the following line: "static const int RV_ENXIO=-4; // no such device or address"
So now I am at a loss. The library has both found and not found my LCD display. I tried both specifying the address in Hello World and not specifying the address, to no avail. The only other thing I changed in the code is the geometry. My display is 20x4.
Now the question. Why can't the display be detected? In spite of the diagnostic, do I have a bad display?
A Google search didn't reveal an answer and neither have I found anything in this forum.