You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Functions/Modules/Analog Input/BpodAnalogIn.m
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -892,11 +892,26 @@ function scope(obj)
892
892
drawnow;
893
893
end
894
894
895
-
function scope_StartStop(obj)
896
-
% scope_StartStop() toggles data acquisition by the scope()
897
-
% GUI. It is called by a start button on the GUI, but it can also be
898
-
% called from a user protocol file to start analog data logging with
899
-
% online monitoring.
895
+
function scope_StartStop(obj, varargin)
896
+
% scope_StartStop This function toggles data acquisition when using the oscilloscope functionality of the AnalogIn module.
897
+
% The function is called by the start button on the oscilloscope GUI, but can also be called from a
898
+
% user protocol to start recording data with online monitoring via the GUI.
899
+
900
+
% :param update_frequency: Update frequency, in seconds (s), for the oscilloscope GUI during data acquisition, defaults to 0.05 (50 ms)
901
+
% :type update_frequency: float, optional
902
+
903
+
904
+
% Default GUI update time is 0.05s
905
+
default_update_time =0.05;
906
+
update_frequency =0;
907
+
908
+
ip =inputParser;
909
+
valid_update_time = @(time) isfloat(time) && isscalar(time) && (time>0); % Update time must be a float, scalar, and greater than zero
910
+
addOptional(ip, 'update_frequency', default_update_time, valid_update_time); % update_frequency is optional, if the passed value is invalid, the default is used
911
+
912
+
parse(ip, varargin{:}); % parse the args
913
+
update_frequency =ip.Results.update_frequency; % assuming all is well, grab the value from the parser
0 commit comments