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, 4, 20)
msgs = [
("Today is April 13th", "My name is CJ Tate.", "I am 24 years old.", "Hello :)"),
("I recently started", "to learn how to code.", "It's been really fun.", "I hope you enjoy!"),
("I am starting my", "first projects of ","the year so far!", ""),
("I made an LED light", "that flashes on a", "timer.", ""),
("Then, I made an ", "LED light that turns", "on when you press a", "button."),
("Most impressive of ", "all, I have built", "a working LCD screen", ""),
("Personally, this is", "the coolest thing", "I have ever built", ""),
("I hope to build even", "more cool things", "and have so much", "fun!"),
]
while True:
for l1, l2, l3, l4 in msgs:
lcd.clear()
lcd.move_to(0, 0)
lcd.putstr(l1)
if l2:
lcd.move_to(0, 1)
lcd.putstr(l2)
if l3:
lcd.move_to(0,2)
lcd.putstr(l3)
if l4:
lcd.move_to(0,3)
lcd.putstr(l4)
sleep(3 if l2 else 5)