Is there a way to check if an I2C device is on the bus?
I have four devices on the bus and three may be removed at some point .
I want to be able to check and count the three if attached.
thanks
devices = 0
I2C.Start()
I2C.WriteByte(I2C_device)
I2C.Stop()
// check NotAcknowledged flag to see if device responded
if (I2C.NotAcknowledged = I2C.IsAcknowledge) then
devices = devices + 1
endif
if (I2C.NotAcknowledged = cbool(I2C.IsAcknowledge)) then
Users browsing this forum: No registered users and 2 guests