getPinAlias

Get alias pin number

Description

example

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.

Examples

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 = 
'D4'

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 = 
'A5'

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