Undefined function 'readVoltage' for input arguments of type 'arduino'.

I have a proper connection between MATLAB and an Arduino (Uno) board. When I first installed Arduino Package in MATLAB I was able to receive a signal from an analog pin on my Arduino board using readVoltage() function. However, after installing ArduinoIO package to add the so-called 'Arduino IO library' library in Simulink browser, I have started to get the following error every time I use the statement, say, readVoltage(a, 'A5'):
Undefined function 'readVoltage' for input arguments of type 'arduino'.
Just for info, I assign a new Arduino object beforehand by typing
a = arduino()
Nothing is really happening though. Any help is appreciated.

 Accepted Answer

After you have established the communication with Arduino using a=arduino, could you type methods(a) and post the results here?

3 Comments

Madhu Govindarajan.
Thank you so much for your consideration.
But I just 'solved' the given problem. As I mentioned above, I had downloaded a new package for Simulink which was located in the space as MATLAB's necessary package to make an interface with Arduino board. Then I removed ArduinoIO package (Simulink package). Guess what? It worked properly, i.e., my MATLAB had a proper interface with my Arduino board.
Probably, there was a traffic between two packages when "arduino" command was called. And maybe not. No matter what the problem was, I can have an interface between MATLAB and an Arduino board.
Thank you again ^_^.
So you just erased the packaged you installed? I got the same problem, and don't know what to do about it :(
@Ricardo - I guess all Aydin is saying - have only MATLAB Support package for Arduino and Simulink Support package for Arduino and this issue does not happen.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!