Serial Communication between arduino uno and matlab?
조회 수: 1 (최근 30일)
이전 댓글 표시
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);
댓글 수: 0
답변 (1개)
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');
댓글 수: 0
참고 항목
카테고리
Help Center 및 File 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!