import time
import board
import busio
i2c = busio.I2C(scl=board.GP1, sda=board.GP0)
while not i2c.try_lock():
pass
try:
addresses = i2c.scan()
if not addresses:
print("Nem találtam I2C eszközt.")
else:
for addr in addresses:
if addr in (0x27, 0x3F) or (0x20 <= addr <= 0x27) or (0x38 <= addr <= 0x3F):
print("LCD cím: 0x{:02X}".format(addr))
finally:
i2c.unlock()
while True:
time.sleep(1)