from machine import I2C, Pin
from time import sleep
from pico_i2c_lcd import I2cLcd
i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)
I2C_ADDR = i2c.scan()[0]
lcd = I2cLcd(i2c, I2C_ADDR, 2, 16)
msgs = [
("What's up y'all", ":)"),
("My name is", "CJ Tate"),
("I like to learn", "how to do"),
("a lot of cool", "things online"),
("One of those", "things is coding"),
("I started a", "few weeks ago"),
("and I think", "It's so much fun"),
("If you are", "reading this..."),
("it is too late..", "")
]
while True:
for l1, l2 in msgs:
lcd.clear()
lcd.move_to(0, 0)
lcd.putstr(l1)
if l2:
lcd.move_to(0, 1)
lcd.putstr(l2)
sleep(2 if l2 else 5)