Hi,
To write arrays to Arduino from MATLAB open a serial connection and connect it to Arduino and then write using ‘fwrite’. For establishing serial communication,
arduino = serial('COMx');
set(arduino,'DataBits',8);
set(arduino,'StopBits',1);
set(arduino,'BaudRate',9600);
set(arduino,'Parity','none');
fopen(arduino);
and write using
data=1:9;
fwrite(Arduino,data,'uint16');
1 Comment
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/501455-how-to-send-multiple-integer-values-from-matlab-to-arduino-ide#comment_788722
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/501455-how-to-send-multiple-integer-values-from-matlab-to-arduino-ide#comment_788722
Sign in to comment.