#First Code
'''
from machine import SoftI2C, Pin
import machine
i2c = SoftI2C(scl=Pin(22), sda=Pin(21))
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))
'''
# Second Code
from machine import I2C, Pin
from i2c_lcd import I2C_LCD
from time import sleep_ms
i2c = I2C(scl=Pin(22), sda=Pin(21))
LCD = I2C_LCD(i2c,0x27)
LCD.print("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
sleep_ms(4000)
LCD.clear()
LCD.puts("Hello World (-: ")
n = 0
while 1:
LCD.puts(n,0,1)
n += 1
sleep_ms(1000)