Real time EEG with Olimex
조회 수: 3 (최근 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!