from machine import Pin
from Rp2 import I2cLcd
import utime
I2C_ADDR = 27
I2C_NUM_ROWS = 2
I2C_NUM_COLS = 16
i2c =I2C(0,sda=Pin(0),scl=Pin(1),freq=40000)
lcd = I2cLcd(i2c,I2C_ADDR,I2C_NUM_ROWS,I2C_COLS)
def greeting():
lcd.clear()
lcd.move_to(5,0)
lcd.putstr("Welcom")
lcd.move_to(3,1)
lcd.putstr("To Python Class")
utime.sleep(2)
lcd.clear()
def customchar():
lcd.custom_char(0,bytearray([
0x0E,
0x0F,
0x04,
0x1F,
0x04,
0x0E,
0x0A,
0x0A
]))
while True:
greeting()
customchar()
lcd.putstr("Custom Character")
lcd.move_to(0,1)
lcd.putchar(char(0))