Main Content

getI2CTerminals

Get terminals with I2C functionality

Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.

Description

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.

example

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.

Version History

Introduced in R2015b