Why doesn't the updated Arduino Interfacing command "configurePin" work while "configureDigitalPin" and "configureAnalogPin" still do?

I am using an Arduino Uno interface to talk to an old spectrometer through Matlab. The paper I am basing the design on is a few years old, and used the "configureDigitalPin" command to set the input/output state of all the major pins at the start of the program. While clarifying a syntax thing I noticed the following message: "configureDigitalPin will be removed in a future release. Use configurePin instead."
I attempted to change over to the new command, but now every time run the command I get the following error: Undefined function 'configurePin' for input arguments of type 'arduino'." I am not sure what this means, but I can't seem to make it accept the function.
My full program works perfectly with the old command but I would like to switch over to the new command to prevent headaches later. Any ideas what could be going on?
Here is the test program I am using:
a = arduino('COM3','uno');
configurePin(a,2,'output')
clearvars a

Answers (2)

configurePin is new as of R2015a . You might be looking at current documentation but using an older version.
It would be helpful to know what release of MATLAB you are using etc. Because if you are getting an warning message that says configurePin then you might already have it. I am not sure, but for what it is worth (I am using MATLAB R2015a)-
When I tried your syntax, the error message that I got was 'Invalid pin format. Pin number must be a string. For example, 'D2' or 'A3'.'
When I changed the command to --> configurePin(a,'D7','output'), the error that I got was
Invalid digital pin mode. The mode must be a string. Valid mode values are: DigitalInput, DigitalOutput, Pullup, PWM, Servo, SPI, I2C, Unset.
Then I changed the command to --> configurePin(a,'D7','DigitalOutput') and everything worked

Asked:

on 20 Sep 2015

Answered:

on 24 Sep 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!