from machine import Pin, SoftI2C sdaPIN=Pin(21) sclPIN=Pin(22) i2c=SoftI2C(sda=sdaPIN, scl=sclPIN, freq=10000) devices = i2c.scan() if len(devices) == 0: print("Sin dispositivos I2C") else: print('Dispositivos I2C encontrados:',len(devices)) for device in devices: print("Dirección: ",hex(device))