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.


Check if terminal can be used as a digital pin


result = isTerminalDigital(arduinoObj, terminal)



result = isTerminalDigital(arduinoObj, terminal) checks if the specified terminal on the Arduino® board can be used a digital pin.


collapse all

Check if terminal 2 on your Arduino Uno hardware can be used as a digital pin.

arduinoObj = obj.Parent
result = isTerminalDigital(arduinoObj, 2)
result = 

Check if analog pin on your Arduino Leonardo can be used as digital pin. It is useful if you have multipurpose pins.

Create an arduino object, and get terminal number from analog pin A6.

arduinoObj = obj.Parent
getTerminalsFromPins(obj, 'A6')
ans =


Check if the terminal can be used as a digital pin.

result = isTerminalDigital(obj, 4)
result = 

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.

Terminal number on Arduino hardware, specified as a double. For more information on terminal and pin numbers, see Physical Terminals and Pin Numbers.

Output Arguments

collapse all

Terminal type, returned as a boolean to indicate if terminal is digital

Introduced in R2015b