Error trying to turn on arduino
Show older comments
I'm attempting to get a program running throw matlab to the arduino, I believe I have the com port set up and working correctly. The error occurs in the loop while trying to blink the led on the 1st writeDigitalPin line. I will include my input output lines hopefully it will help.
Input
instrfind
a=arduino('COM4');
for i = 1:10
writeDigitalPin(a, 11, 0);
pause(0.5);
writeDigitalPin(a, 11, 1);
pause(0.5);
end
OUTPUT
Serial Port Object : Serial-COM4
Communication Settings
Port: COM4
BaudRate: 9600
Terminator: 'LF'
Communication State
Status: open
RecordStatus: off
Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 3
ValuesSent: 1
Undefined function 'arduino' for input arguments of type
'char'.
Error in arduinotest (line 4)
a=arduino('COM4');
4 Comments
Geoff Hayes
on 10 Mar 2018
Bhagyashri Dengale's answer moved here
I had installed arduino in matlab successfullly. But it can not run by this code a= arduino('com7''uno') please help me.
Geoff Hayes
on 10 Mar 2018
Bhagyashri - please copy and paste the full error message here.
Bhagyashri Dengale
on 11 Mar 2018
a=arduino('uno') Undefined function 'arduino' for input arguments of type 'char'.
Geoff Hayes
on 11 Mar 2018
This error message is telling you that the arduino function cannot be found. You mention that you have installed arduino successfully, but perhaps you need to add the location of this package to your MATLAB search path.
Accepted Answer
More Answers (0)
Categories
Find more on Troubleshooting in 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!