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.


Get alias pin number


out = getPinAlias(arduinoObj, pin)



out = getPinAlias(arduinoObj, pin) returns an alias for the specified pin on your Arduino® hardware when there are two labels for the same pin. If your pin does not have two labels, it returns the same number back.


collapse all

Get the alternate pin name for the analog pin 'A6' on your Arduino Leonardo. On Arduino Leonardo, 'D4' is also labeled as 'A6'.

arduinoObj = obj.Parent;
out = getPinAlias(arduinoObj, 'A6')
out = 

Arduino Uno does not have aliased pins. When asked for an alias, the command returns the same pin number.

arduinoObj = obj.Parent;
out = getPinAlias(arduinoObj, 'A5')
out = 

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.

Pin number, specified as a character vector.

Output Arguments

collapse all

Alternate name of the pin on the Arduino device, specified as a character vector. If no alternate pins names exist, getPinAlias returns the input pin number.

Introduced in R2015b