Real time EEG with Olimex

3 次查看(过去 30 天)
Lisa Suette
Lisa Suette 2021-6-23
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 个)

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by