from pyb import I2C
i2c = I2C(1) # create on bus 1
i2c = I2C(1, I2C.MASTER) # create and init as a master
i2c.init(I2C.MASTER, baudrate=400000) # init as a master
i2c.init(I2C.SLAVE, addr=0x98) # init as a slave with given address
i2c.is_ready(0x98) # check if slave 0x42 is ready
i2c.scan() # scan for slaves on the bus, returning