Commit 615feed1 authored by Jesse Heckman's avatar Jesse Heckman

incorporate lightwarning

parent b503cdb8
......@@ -52,6 +52,7 @@ function pb_vRunExp(handles)
% start vestibular chair
if ~ismac && ~debug
vs = pb_sendServo(profile);
pb_lightwarning;
blockTime = tic;
pb_startServo(vs);
pause(4*pi); % allow vestibular chair to get in sync with input signal
......@@ -86,6 +87,7 @@ function pb_vRunExp(handles)
if ~ismac && ~debug
elapsedTime = toc(blockTime);
if elapsedTime < dur; pause(dur-floor(elapsedTime)+(4*pi)); end % wait untill chair is finished running before disabling.
pb_lightwarning;
pb_stopServo(vs);
Dat(iBlck) = pb_readServo(vs, Dat(iBlck));
delete(vs);
......
......@@ -11,20 +11,16 @@ function pb_lightwarning()
leds = ledcontroller_pi('dcn-led06','dcn-led07','dcn-led09','dcn-led10');
n = 4;
n = 6;
s = ledpattern(n);
ir = 50;
ig = ir;
% Sequence needs updating due to new SLC distribution
seq1 = [0:9 fliplr(16:1:63)]; %% [0:2:63];
seq2 = []; %% [1:2:63];
for iC = 1:n
if mod(iC,2) == 0
if mod(iC,2) == 1
s(iC).set(seq1,'r');
else
s(iC).set(seq2,'g');
end
s(iC).intensity('r', ir);
s(iC).intensity('g', ig);
......@@ -34,9 +30,10 @@ function pb_lightwarning()
for iC = 1:n
leds.trigger;
if ~iseven(iC); pause(0.3); else; pause(0.15); end
if ~iseven(iC); pause(0.1); else; pause(0.1); end
end
delete(s);
delete(leds);
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