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)
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
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?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB Support Package for Arduino Hardware dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by