Can't connect MATLAB 2016 to Arduino using arduino() function ??
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kazi
le 28 Mai 2016
Commenté : Walter Roberson
le 10 Mar 2019
Hi,
I am working on a servo motor that's gonna receive an angle value from matlab. Previously we were using arduino ide but there were problems in creating an arduino serial communication. Then we began using serial communication with arduino built-in function in matlab 2016.
But problem did not go away. Even a few minutes ago, the servo was doing the job. Then when we ran the program again, this popped up, again,
" Failed to open serial port COM5 to communicate with board Mega2560. Make sure there is no other MATLAB arduino object for this board. For troubleshooting, see Arduino Hardware Troubleshooting."
This has been really frasustrating ! Please guyz, anyone have any idea what went wrong here or how to solve it ??
Thanks in advance.
a=arduino();
s=servo(a,'D9');
angle=30/180;
writePosition(s,angle);
0 commentaires
Réponse acceptée
Walter Roberson
le 28 Mai 2016
You have an existing arduino object. The single easiest way to make certain it is gone is to restart MATLAB.
2 commentaires
Plus de réponses (1)
HAMZA ABBASI
le 24 Juin 2018
Modifié(e) : HAMZA ABBASI
le 24 Juin 2018
write clear all in the first line of code
3 commentaires
Alex Barbu
le 10 Mar 2019
it doesnt work even I cleared all before writing the code. it gets the same error:
>> a=arduino('COM41','Uno');
Failed to open serial port COM41 to communicate with board Uno. Make sure there is no other MATLAB arduino object for
this board. For troubleshooting, see Arduino Hardware Troubleshooting.
Voir également
Catégories
En savoir plus sur MATLAB Support Package for Arduino Hardware dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!