0

I have connected a I2C LCD with my NodeMCU v3. My pin configuration is as follows:

Node MCU ---> I2C LCD
GND           GND
3V            VIN
SDA           D2
SCL           D1

I have been testing a rather simple code:

#include <LiquidCrystal_I2C.h>

// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;

// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);  

void setup(){
  // initialize LCD
  lcd.init();
  // turn on LCD backlight                      
  lcd.backlight();
}

void loop(){
  // set cursor to first column, first row
  lcd.setCursor(0, 0);
  // print message
  lcd.print("Hello, World!");
  delay(1000);
  // clears the display to print new message
  lcd.clear();
  // set cursor to first column, second row
  lcd.setCursor(0, 1);
  lcd.print("Hello, World!");
  delay(1000);
  lcd.clear(); 
}

But instead of displaying "Hello World" in alternate lines by LCD is displaying scrolling text which seems gibbersih. Can anyone enlighten me in this regard?

enter image description here

Thanks!

1
  • Are you sure the display needs 3.3V? I think 5V ... also, maybe it's needed to use a level shift converter from 3.3V->5V for the I2C lines. – Michel Keijzers Jul 14 '20 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.