Commit 236657f4 authored by Jesse Heckman's avatar Jesse Heckman

implement wait for trigger

parent fba98513
...@@ -17,11 +17,13 @@ function pb_vRunTrial(zbus, cfg) ...@@ -17,11 +17,13 @@ function pb_vRunTrial(zbus, cfg)
disp('Waiting for RZ6 button press/sound/led/acquisition'); disp('Waiting for RZ6 button press/sound/led/acquisition');
t = tic; t = tic;
while ~cfg.RZ6_1.GetTagVal('Wait'); pause(0.05); end
trialdur = cfg.trialdur; trialdur = cfg.trialdur;
if cfg.trig if cfg.trig; trialdur = 15; end
while ~cfg.RZ6_1.GetTagVal('Wait'); pause(0.05); end
else while toc(t) < trialdur || cfg.RZ6_1.GetTagVal('Active')
while toc(t) < trialdur; pause(0.05); end pause(0.05);
end end
end end
......
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