from machine import Pin, SoftI2C
from i2c_lcd import I2cLcd
from utime import sleep, sleep_ms
adress = 0x27
i2c = SoftI2C(scl=Pin(22), sda=Pin(21), freq=100000) # connect scl to GPIO 22, sda to GPIO 21
lcd = I2cLcd(i2c, adress, 2, 16)
# lcd.putstr("Hello!")
# lcd.move_to(10,1)
# lcd.putstr("Hi!")
# sleep(4)
# lcd.clear()
while True:
for i in range(0,16,1):
lcd.move_to(i, 0)
lcd.putstr(">")
sleep(0.2)
lcd.clear()
# sdaPIN = Pin(21) #for ESP32
# sclPIN = Pin(22)
# i2c = SoftI2C(sda=sdaPIN, scl=sclPIN, freq=10000)
# devices = i2c.scan()
# if len(devices) == 0:
# print("No i2c device !")
# else:
# print('i2c devices found:',len(devices))
# for device in devices:
# print("At address: ",hex(device))