Real Time data from matlab to arduino

21 ビュー (過去 30 日間)
Gabriel Enzo
Gabriel Enzo 2022 年 6 月 17 日
コメント済み: Gabriel Enzo 2022 年 6 月 22 日
hello, i have a some project eeg, and i was sending real time data in matlab and i want to send that to arduino uno, maybe somebody help me, thanks
  2 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 17 日
How are you getting the eeg data into the MATLAB host?
Could you confirm that you want to send the raw eeg data to the arduino, without analyzing it (for example to send motor commands to the arduino)?
What data rate do you need, and what latency is acceptable?
Gabriel Enzo
Gabriel Enzo 2022 年 6 月 17 日
i get the eeg data using the streaming layer lab in matlab, then finally out the existing serial data so i have to send it to arduino to drive the motor, for data speed and latency may not be needed which is too fast

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2022 年 6 月 19 日
where it has
while true
% get data from the inlet
[vec,ts] = inlet.pull_sample();
% and display it
fprintf('%.2f\t',vec);
fprintf('%.5f\n',ts);
end
you would change the fprintf() calls to
msg = compose('%.2f\n%.5f', vec, ts); %adjust this format as needed
writeline(s, msg);
where
s = serialport('COM3'); %where COM3 is the location of the serial port connected to the arduino
You would be expected to have a program running on the arduino that reads from the serial port and reads two items, the first being vec and the second being ts, and does something appropriate with the readings.
If you are planning to run a motor, then typically instead of sending the raw eeg data, you would analyze the data at the MATLAB level and then send commands to the arduino.
Alternately, if you can use a Due or Mega, then https://www.starcat.io/ makes an EEG shield that can directly receive Lab Streaming Layer on the Due or Mega, without going through MATLAB.
  2 件のコメント
Gabriel Enzo
Gabriel Enzo 2022 年 6 月 20 日
oh okey will try that
Gabriel Enzo
Gabriel Enzo 2022 年 6 月 22 日
thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

タグ

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by