pb_vRunTrial.m 1.02 KB
Newer Older
Jesse Heckman's avatar
Jesse Heckman committed
1
function pb_vRunTrial(zbus, cfg)
Jesse Heckman's avatar
Jesse Heckman committed
2 3 4 5 6 7 8 9
% PB_VRUNTRIAL(HANDLES)
%
% PB_VRUNTRIAL(HANDLES)  ...
%
% See also ...

% PBToolbox (2018): JJH: j.heckman@donders.ru.nl

Jesse Heckman's avatar
Jesse Heckman committed
10
   %% Run zBus
Jesse Heckman's avatar
Jesse Heckman committed
11
   zbus.zBusTrigA(0, 0, 2); % reset, clock start, (0,0,2): trigger entire rack, with a pulse structure, and 2 ms delay(2 ms = minimum).
Jesse Heckman's avatar
Jesse Heckman committed
12

Jesse Heckman's avatar
Jesse Heckman committed
13
   %% Trigger event 1
Jesse Heckman's avatar
Jesse Heckman committed
14
   zbus.zBusTrigB(0, 0, 2); % start event 1/trial onset; trigger zBus 4 = RA16;
Jesse Heckman's avatar
Jesse Heckman committed
15 16 17
   
   %% Button Press
   disp('Waiting for RZ6 button press/sound/led/acquisition');
Jesse Heckman's avatar
Jesse Heckman committed
18

Jesse Heckman's avatar
Jesse Heckman committed
19
   t           = tic;
Jesse Heckman's avatar
Jesse Heckman committed
20
   
Jesse Heckman's avatar
Jesse Heckman committed
21
   if ~cfg.trig
Jesse Heckman's avatar
Jesse Heckman committed
22
      while toc(t) < cfg.trialdur; pause(0.05); end 
Jesse Heckman's avatar
Jesse Heckman committed
23
   else
Jesse Heckman's avatar
Jesse Heckman committed
24
      while ~cfg.RZ6_1.GetTagVal('Wait'); pause(0.05); end 
Jesse Heckman's avatar
Jesse Heckman committed
25
   end
Jesse Heckman's avatar
Jesse Heckman committed
26 27 28 29 30 31 32 33 34
end
 
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 
%                                                           %
%       Part of Programmeer Beer Toolbox (PBToolbox)        %
%       Written by: Jesse J. Heckman (2018)                 %
%                                                           %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %