from machine import Pin,I2C
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)
button=Pin(5,Pin.IN,Pin.PULL_UP)
while True:
b=button.value()
if(b==0):
lcd.move_to(0,0)
lcd.putstr("button pressed")
sleep(1)
else:
lcd.move_to(0,0)
lcd.putstr("button not pressed")
sleep(1)