필터 지우기
필터 지우기

Serial port and current operation (Arduino)

조회 수: 2 (최근 30일)
Jasmine Shragai
Jasmine Shragai 2016년 9월 22일
편집: Hans Scharler 2018년 7월 20일
Hello!
I am working with Matlab on Arduino (using G-Code) and am having some trouble.
For example, I would like to run a script in MATLAB that contains a loop. The thing is, that Matlab doesn't know that the Arduino is not finished with current operation yet, and is continuing the code, ignoring this.
As a result, the Arduino actually performs only the first operation.
How can Matlab know when Arduino is finished current operation? Maybe the is a method for all kinds of COM connections?
Thanks!
Jasmine

채택된 답변

Walter Roberson
Walter Roberson 2016년 9월 22일
편집: Walter Roberson 2016년 9월 22일
The official way for serial ports is to configure the serial port with 'flowcontrol' set to 'hardware', and have the arduino lower the CTS (Clear To Send) pin while it processes the data, setting it high again when it is ready for more.
  댓글 수: 1
Jasmine Shragai
Jasmine Shragai 2016년 9월 22일
Thank you!! I actually had to set it to 'software' for it to work. But works like a charm!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by