Warning: Unsuccessful read: A timeout occurred before the Terminator was reached. 'serial' unable to read any data
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello!
I am trying to read data from Arduino uno but get this error
"Warning: Unsuccessful read: A timeout occurred before the Terminator was reached. 'serial' unable to read any data".
Can anyone help me please?
Thank you in advance!
clear All
close All
COM = serial('COM2','BaudRate',9600);%5,'Terminator','CR');
set(COM,'TimeOut',10)
fopen(COM);
interv = 240;
init_time = 1;
x =0;
while (init_time < interv)
b = fscanf(COM) ;
b = b(2:end-2);
b = bin2dec(b);
x = [x,b];
plot(x);
grid on ;
init_time = init_time+1;
drawnow;
end
fclose(COM);
delete(COM);
clear COM;
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su MATLAB Support Package for Arduino Hardware in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!