Scan arduino for devices on the I2C bus.
ar - arduino object connected to a arduino board.
bus - bus number to scan I2C devices, when multiple buses are available. If the bus is not specified, it will default to 0.
retval - cell array of addresses as strings in format of "0xXX".
# create arduino connection.
ar = arduino();
# scan for devices on the I2C bus
scanI2Cbus (ar)
# output is each detected i2c address as a string
ans =
{
[1,1] = 0x50
}
See also: arduino, i2cdev, checkI2CAddress.
Package: arduino