Search code examples
i2carduino-idearduino-esp8266

16X02 not giving any character in display


I want to display some string on 16X02 lcd. For the time being, I am implementing the example given in the following link. My 16X02 lcd's backlight is on and bright, but it is not giving any character as display. What should I do now?

https://www.losant.com/blog/how-to-connect-lcd-esp8266-nodemcu

#include <LiquidCrystal_I2C.h>

// Construct an LCD object and pass it the 
// I2C address, width (in characters) and
// height (in characters). Depending on the
// Actual device, the IC2 address may change.
LiquidCrystal_I2C lcd(0x27, 16, 2); // my lcd pin address is different from the example

void setup() {

  // The begin call takes the width and height. This
  // Should match the number provided to the constructor.

  Serial.begin(115200);
  Serial.println ("In Setup");
  lcd.begin(16,2);
  lcd.init();

  // Turn on the backlight.

  lcd.backlight();

  // Move the cursor characters to the right and
  // zero characters down (line 1).

  lcd.setCursor(5, 0);

  // Print HELLO to the screen, starting at 5,0.

  lcd.print("HELLO");

  // Move the cursor to the next line and print
  // WORLD.

  lcd.setCursor(5, 1);      
  lcd.print("WORLD");
}

void loop() {
}

Solution

  • I'm assuming you are verified your physical connection and providing proper voltage supply.

    Are you using the same I2C to GPIO expansion module PCF8574. If no the you may need to modify the LCD module.

    Also verify if you have set the proper contrast voltage by adjusting the pot. You should first set it to value where by you can see all background dots (pixels); once text is visible you can set it to optimum value.