Commit 6f69f5bc authored by Jesse Heckman's avatar Jesse Heckman

implement wait for trigger

parent 24520dae
......@@ -18,8 +18,12 @@ function cfg = pb_vClearTrial(stim, cfg)
stim(iStm).ledhandle.delete; % delete(leds)/switch off light;
end
end
if isfield(stim(iStm),'ledhandle')
end
end
%% Turn off sounds
for muxIdx = 1:4
......
function pb_vRunTrial(zbus, trialdur)
function pb_vRunTrial(zbus, cfg)
% PB_VRUNTRIAL(HANDLES)
%
% PB_VRUNTRIAL(HANDLES) ...
......@@ -14,6 +14,9 @@ function pb_vRunTrial(zbus, trialdur)
zbus.zBusTrigB(0, 0, 2); % start event 1/trial onset; trigger zBus 4 = RA16;
t = tic;
trialdur = cfg.trialdur;
if cfg.trig; trialdur = 10; end
while toc(t) < trialdur
pause(0.05);
end
......
......@@ -11,6 +11,7 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
%% SET TDT PARAMETERS
selled = strcmpi({stim.modality},'LED');
selsnd = strcmpi({stim.modality},'sound');
seltrg = strcmpi({stim.modality},'TRG0');
%% LED
if any(selled)
......@@ -67,6 +68,10 @@ function [stim, cfg] = pb_vSetupTrial(stim,cfg)
cfg.maxSamples = 0;
%% TRIGGER
cfg.trig = any(seltrg);
%% WAIT
ev = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment