I have a generic HD44780 compatible 16x2 LCD display, with an already soldered on PCF8574 module. Its backlight is blue, and the characters are supposed to be white (on blue).
It is connected to a generic "Lolin" ESP8266 module which is working fine and is not related to the problem, I hope.
Using the LiquidCrystal_I2C library available at https://github.com/lucasmaziero/LiquidCrystal_I2C, I uploaded the simple "Hello, World" sketch provided, and it works. Used the most current libraries and Arduino IDE as of 2019-03-20.
However, the text displayed is a very dim black-on-blue instead of a bright white-on-blue.
I do not have any clue on why it happens and how to fix it (and that's my question).
What I know is that if I somehow "glitch" the display (for example by disconnecting and reconnecting the power lead) it will sometimes display gibberish, but in a very clear white-on-blue, so I know the LCD hardware is not defective per se.
I also tried a few other libraries to the same effect: LiquidCrystal_PCF8574 and LiquidCrystal_I2C (the version available directly from the Arduino IDE, source at https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library)
Below, the example sketch used to generate the problem. Be aware it is for the first LiquidCrystal_I2C library I referred above, but with changes, works with the others I tried.
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
// initialize the LCD
lcd.begin(); // Init with pin default ESP8266 or ARDUINO
// lcd.begin(0, 2); //ESP8266-01 I2C with pin 0-SDA 2-SCL
// Turn on the blacklight and print a message.
lcd.backlight();
lcd.setCursor(0, 0);
#if defined(ESP8266)
lcd.print("ESP8266");
#else
lcd.print("ARDUINO");
#endif
lcd.setCursor(0, 1);
lcd.print("Hello, world!");
}
void loop()
{
// Do nothing here...
}
And a photo of the anomalous display. Turning the constrast potentiometer does not help.