Code finished

master
mDescape 2 years ago
parent 6f3263dc84
commit 36cda3c322
  1. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_0.2s1Repetitions_22-06-2020_13.22.45.mat
  2. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_0.2s1Repetitions_22-06-2020_13.22.45.png
  3. 15
      Code/Matlab/VisualThresholdsExperiment.m
  4. BIN
      Documents/Technical_report_Descalzo.docx
  5. BIN
      Documents/Technical_report_Descalzo.pdf

@ -49,6 +49,11 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
keyList(ESC) = 1;
keyList(AKEY) = 1;
keyList(FKEY) = 1;
% Open serial port
delete(instrfind);
s = serial("COM6", 'BaudRate', 115200, 'TimeOut', 5, 'Terminator', 'LF');
fopen(s);
% Collect Participant's Information
titleBar = 'Informaci<EFBFBD>n del Participante';
@ -180,6 +185,12 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
%READ THE SAFETY ADD-ON HERE
%if not safe -> break everything and close with a warning
if(s.BytesAvailable > 0)
if(fgets(s) == "h")
warning("Stimulus not safe.");
break;
end
end
% Get participant's response
if isDown
@ -292,6 +303,10 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
end
Screen('Close', wPtr);
% Close the serial port
fclose(s);
delete(s);
clear s
responses(trial:end) = [];
reactionTimes(trial:end) = [];

Loading…
Cancel
Save