Real time EEG with Olimex
4 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I need to write a code to plot a real time EEG of 2 Channels with the Olimex Amplifier. My problem is that I don't get any values from my amplifier. My code looks like this so far:
clc;
clear;
if ~isempty(instrfind)
fclose(instrfind);
delete(instrfind);
end
EEG = serial("COM3","BaudRate",57600, "Timeout",30);
%readline(EEG)
EEG.Terminator = "CR/LF";
EEG.InputBufferSize = 65000;
fopen(EEG);
%a = fscanf(EEG);
i = 1;
while(1)
data(i) = str2double(fscanf(EEG));
plot(data)
drawnow()
i = i+1;
pause(0.001)
%daten = readline(EEG)
end
but everytime I get this warning:
Warning: Unsuccessful read: The input buffer was filled before the Terminator was reached.
'serial' unable to read all requested data. For more information on possible reasons, see Serial Read Warnings.
and instead of some data I just get an array full of "NaN"s so I think that the mistake has to be in the line with str2double(fscanf(EEG)) because for my EEG data I always get something like this:
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で EEG/MEG/ECoG についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!