This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Scan BBC micro:bit board for I2C device addresses


addr = scanI2CBus(microbitObj)



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.


collapse all

microbitObj = microbit('COM3');
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.

See Also

Introduced in R2017b