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

updated servo

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