Hello,

A way to check for I2C devices is:

I2Cstart
I2Cwbyte i2c_address
I2Cstop
If err = 0 then print”I2C Device found” else print”No I2C Device”

When the master sends a byte over the I2C Bus then the slave must respond with an acknowledgment.
If the slave responds then the err = 0 but if the slave does not respond (or there is no I2C device) then the err = 1

Greetings,
Windt H.J.