I have got "Error using serial/fopen (line 72) Open failed: Port: COM5 is not available. No ports are available. Use INSTRFIND to determine if other instrument objects are connected to the requested device. Error in viread (line 5) fopen (comport);"
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
my code body is
clear all;
clc;
close all;
comport=serial('COM5','Baudrate',9600);
fopen (comport);
x=0;
while(x<100)
x=x+1;
v1(x)=fscanf(comport, '%d');
plot(v1,'r--','linewidth',3)
grid on;
hold on;
end
fclose(comport);
delete(comport);
1 commentaire
Walter Roberson
le 26 Mar 2016
Is the arduino connected to COM5?
What happened when you use instrfind to find out what was already in use?
Réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Support Package for Arduino Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!