EEG实验中Matlab并口数据位发送和接收的实现方法 - 知乎
实验脚本
注:每次打marker后需要清零
放在输入被试编号后
measureEEG = 0;
if subNum ~= 0
ioObj = io64; %initialize inpout64.dll device driver
if ( io64(ioObj) == 0 )
disp(' ');
disp('inpout64.dll successfully installed.')
else
disp('inpout64.dll installation failed.')
return
end
address = hex2dec('3EFC'); % 检查电脑并口
% set the output to 0.
data_out = 0;
io64(ioObj,address,data_out);
WaitSecs(0.1);
measureEEG = 1;
end
放在每个试次开始前
%trialstart marker
if measureEEG == 1
data_out = trial_data{ai,12};
io64(ioObj,address,data_out);
WaitSecs(0.01);
data_out = 0;
io64(ioObj,address,data_out);
end
放在每个试次结束后
if measureEEG == 1
data_out = 0;
io64(ioObj,address,data_out);
end