Warning: Unsuccessful read: Matching failure in format.

1 次查看(过去 30 天)
hi all , i'm getting this error whentrying to read serial data send from arduino in matlab
clear all
close all
clc
% create serial communication object on port COM14
arduin=serial('COM14','BaudRate',9600);
fopen(arduin); % initiate arduino communication
% You must call TIC without an output argument before
% calling TOC without an input argument.
tic;
% data va recevoir le type de mesure
while (toc<=20) % stop after 20 secs
data = fscanf(arduin,'%f');
end
fclose(arduin); % end communication with arduino
thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for Arduino Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by