Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Difference in sending data from Arduino and Matlab?

1 回表示 (過去 30 日間)
Berke Ogulcan Parlak
Berke Ogulcan Parlak 2020 年 6 月 3 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
There is a code in the Arduino that transmits three values received respectively. I am sending these three values from Arduino in the following order:
As you can see, I sent the values 1234, 500 and 8900 respectively, and the code transmitted this in the same order.But when I try to send these values from matlab in the same way:
s = serial('COM7','Baudrate',9600);
fopen(s);
kp = '1234\\\\';
ki = '500\\\\\';
kd = '8900\\\\';
fwrite(s,kp);
fwrite(s,ki);
fwrite(s,kd);
for i = 1:8
a = fscanf(s)
b = fscanf(s)
c = fscanf(s)
end
fclose(s);
This is the output of the code:
Can you help me fix the Matlab code?

回答 (0 件)

この質問は閉じられています。

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by