import time
from machine import I2C, SoftI2C, Pin,
from pico_i2c_lcd import I2cLcd
i2c = SoftI2C(sda=Pin(20),scl=Pin(19),freq=400000)
lcd_addr = i2c.scan()[0]
print(lcd_addr)
lcd = I2cLcd(i2c,lcd_addr,2,16)
text = ' Hello World!' # Show scrolling information
print(len(text))
while True:
tmp = text # Get the display information
for i in range(0, len(text)):
lcd.move_to(len(text),1) # Position cursor
lcd.putstr(tmp) # Display one by one
tmp = tmp[1:]
time.sleep(0.3) # Delay 800ms
lcd.clear()
for i in range(0, len(text)):
lcd.move_to(len(text)-i,0) # Position cursor
lcd.putstr(tmp) # Display one by one
tmp = text[:i+1]
time.sleep(0.3) # Delay 800ms
lcd.clear()