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.

getI2CTerminals

Get terminals with I2C functionality

Syntax

terminals = getI2CTerminals(arduinoObj)
terminals = getI2CTerminals(arduinoObj, bus)

Description

example

terminals = getI2CTerminals(arduinoObj) returns terminals with I2C functionality on your Arduino® board.

terminals = getI2CTerminals(arduinoObj, bus) returns terminals for the specified I2C bus on your Arduino board.

Examples

collapse all

Get I2C terminals on an Arduino Uno device that can have I2C functionality.

arduinoObj = obj.Parent;
terminals = getI2CTerminals(arduinoObj)
terminals = 
18 19

Input Arguments

collapse all

Arduino object, specified as an object that is an internal variable called from within classes that derive from matlabshared.addon.LibraryBase.

I2C device bus, specified a number.

If you are using an Arduino Due device, use bus 0 for SDA and SCL and bus 1 for SDA1 and SCL1.

Output Arguments

collapse all

I2C terminals, returned as a double or an array of doubles. For more information on terminal and pin numbers, see Physical Terminals and Pin Numbers.

Introduced in R2015b