필터 지우기
필터 지우기

Serial Communication between arduino uno and matlab?

조회 수: 2 (최근 30일)
Rishabh Garg
Rishabh Garg 2016년 5월 4일
답변: Walter Roberson 2016년 5월 4일
I am trying to open folder('C:') with serial communication via Arduino Uno. Can anyone tell me what is the problem in code? Code am using is:
s=serial('COM4');
fopen(s);
tic
while (toc<1)
A=fscanf(s);
if ( A == '1')
winopen('C:')
end
end
fclose(s);
delete(s);

답변 (1개)

Walter Roberson
Walter Roberson 2016년 5월 4일
If you want to read one byte at a time you should use fread() instead of fscanf
A = fread(s, 1, 'char');

카테고리

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