# LCD
from machine import Pin, SoftI2C
from i2c_lcd import I2cLcd
from time import sleep
# I2C setup for general use
sda_pin = Pin(21) # for ESP32
scl_pin = Pin(22)
i2c_general = SoftI2C(scl=scl_pin, sda=sda_pin, freq=10000)
# I2C setup specifically for the LCD display
I2C_ADDR = 0x27
total_rows = 2
total_columns = 16
i2c_lcd = SoftI2C(scl=Pin(22), sda=Pin(21), freq=10000)
# Initialize the LCD object
lcd = I2cLcd(i2c_lcd, I2C_ADDR, total_rows, total_columns)
# Display some text
lcd.clear()
lcd.putstr("Hello, MicroPython!")
sleep(3)
# Clear the LCD again
lcd.clear()