I am trying to set a serial link in Matlab using an Arduino board. Reading data from the board is going well. However, writing data to the board takes about a second for each block of information I send.
The code I run to write data is:
s = serial(comprt,'BaudRate',9600,'DataBits',8);
fopen(s);
fprintf(s, '%c', 'c');
fprintf(s, '%u %u %u %u \n', [A B C D]);
pause(1);
fprintf(s, '%c', 'a');
pause(1);
A, B, C, D are 8-bit numbers from 0 to 255, 'c' and 'a' are character commands that do things on the Arduino board and click on the firmware on the board.
If I do not turn on pause commands (1), so when I do not stop Matlab from executing the next command for at least a second, the serial information does not pass.
Can someone help me speed up recording material to the serial port? I checked with the Arduino editor, and when I enter the equivalent commands through their interface, everything is fine. Thus, delays are not related to the Arduino board or device drivers, this is definitely on the Matlab side.
source
share