Commit dab5e229 authored by Jesse Heckman's avatar Jesse Heckman
Browse files

updated servo

parent d7f21ff6
......@@ -51,8 +51,8 @@ function pb_vRunExp(handles)
% start vestibular chair
if ~ismac && ~debug
pb_sendServo(vs, profile);
pb_startServo(vs);
pb_sendServo(profile);
vs = pb_startServo;
pause(6); blockTime = tic; % allow vestibular chair to get in sync with input signal
end
......@@ -85,7 +85,8 @@ function pb_vRunExp(handles)
elapsedTime = toc(blockTime);
if elapsedTime < dur; pause(dur-floor(elapsedTime)); end % wait untill chair is finished running before disabling.
Dat = pb_stopServo(vs);
pb_stopServo(vs);
Dat = pb_readServo;
end
% stop recording
......
function D = pb_readServo(vs)
function D = pb_readServo
% PB_READSERVO()
%
% PB_READSERVO() ...
......@@ -7,9 +7,9 @@ function D = pb_readServo(vs)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs=vs_servo;
[sv.vertical,sv.horizontal] = vs.read_profile_sv;
[pv.vertical,pv.horizontal] = vs.read_profile_pv;
delete(vs);
D.sv = sv;
......
function pb_sendServo(vs,profile)
function pb_sendServo(profile)
% PB_SENDSERVO()
%
% PB_SENDSERVO() ...
......@@ -6,8 +6,9 @@ function pb_sendServo(vs,profile)
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs = vs_servo;
vs.write_profile(profile.v,profile.h);
delete(vs);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
......
function pb_startServo(vs)
function vs = pb_startServo
% PB_STARTSERVO()
%
% PB_STARTSERVO() ...
......@@ -7,6 +7,9 @@ function pb_startServo(vs)
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
vs = vs_servo;
vs.enable;
pause(1);
vs.start;
end
......
......@@ -9,9 +9,6 @@ function pb_stopServo(vs)
vs.stop;
vs.disable;
Dat = pb_readServo(vs);
delete(vs);
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