Main Content

scanI2CBus

Scan BBC micro:bit board for I2C device addresses

Description

example

addr = scanI2CBus(microbitObj) scans the I2C bus on the BBC micro:bit board, specified as a microbit object, and stores the addresses of the discovered I2C devices in the variable addr.

Examples

collapse all

microbitObj = microbit('COM3');
scanI2CBus(microbitObj)
ans =  
  1×2 string array 
    "0xE"    "0x1D" 

Input Arguments

collapse all

BBC micro:bit hardware connection, specified as a microbit object created with the microbit function.

Output Arguments

collapse all

Addresses of I2C devices connected to the I2C bus on the BBC micro:bit board, returned as a string array.

Version History

Introduced in R2017b

See Also