Lookup here …
Micropython & HD44780 LCD
Introduction
The HD44780 is a very common and versatile liquid crystal display (LCD). It’s widely used in various electronic devices, including calculators, digital clocks, meters, and many more.


Example: How to use an HD44780 (I2C)
Wiring

Code
Find the LCD library at: https://github.com/dhylands/python_lcd/tree/master
from machine import Pin, SoftI2C, ADC
from i2c_lcd import I2cLcd
from time import sleep
oldVal = 0
newVal = 0
# Define the LCD I2C address and dimensions
I2C_ADDR = 63
I2C_NUM_ROWS = 4
I2C_NUM_COLS = 20
# Define pin 5 for analog reading
pot = ADC(Pin(0))
pot.atten(ADC.ATTN_11DB) #Full range: 3.3v
# Initialize I2C and LCD objects
i2c = SoftI2C(sda=Pin(6), scl=Pin(7), freq=800000)
lcd = I2cLcd(i2c, I2C_ADDR, I2C_NUM_ROWS, I2C_NUM_COLS)
# Clear the display and set the cursor left,top
lcd.clear()
lcd.move_to(0,0)
try:
while True:
for i in range(0,30):
pot_value = pot.read()
newVal += (pot_value >> 4)
newVal = int(newVal/30)
print(newVal)
lcd.putstr("Potentiometer value:")
lcd.move_to(0,2)
if not newVal == oldVal: # check if the the potentiometer value has changed so LCD is only updated if necessary
lcd.putstr(str(newVal))
oldVal = newVal
else:
lcd.putstr(str(oldVal))
sleep(0.1)
lcd.move_to(0,0)
lcd.clear()
except KeyboardInterrupt:
# Turn off the display
print("Keyboard interrupt")
lcd.backlight_off()
lcd.display_off()