Driving an LCD using I2C

You can use your ESP8266 to communicate with I2C devices such as LCD displays, sensors, other microcontrollers, etc. This example writes to a 20x4 character LCD.
You can
use most types of Hitachi HD44780 compatible LCDs providing they also have an I2C backpack to change the interface from 4- or 8-bit parallel to I2C.
If you're ordering an LCD, ensure that it has the backpack included; otherwise you can order them separately and solder them together yourself.

Not all I2C backpacks have the same bus address. They are usually either
0x27 or 0x3F so you could try both to see which is correct. Alternatively, you can use the I2C scanner
here to scan the whole range
of possible I2C pins and addresses.

The four connections required for I2C are +3.3V, GND, SCL and SDA. The
pins to use for SCL and SDA are not fixed and are
specified in the setup() function in your sketch and can be any pair from the range D0 to D7. There may be issues using D8,
so avoid using that. Also, if you wish to use the onboard LED, that's on D2, so keep that free.