Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
ButtonBoxes
(view source)
Revision as of 17:04, 11 March 2016
216 bytes added
,
17:04, 11 March 2016
no edit summary
Line 343:
Line 343:
% or
% or
%
%
−
% to send a marker: (marker: a numeric value)
+
% to send a marker: (marker: a numeric value
; Fs: sampling frequency device
)
−
% buttonbox(marker)
+
% buttonbox(marker
,Fs
)
%
%
% or
% or
Line 362:
Line 362:
bb.StopBits = 1;
bb.StopBits = 1;
bb.Parity = 'none';
bb.Parity = 'none';
+
if nargin < 1
if nargin < 1
cmd = 'open';
cmd = 'open';
end
end
−
if nargin > 1
+
if nargin > 1
&& isstruct(varargin{1})
% user overwrites default settings
% user overwrites default settings
flds = fields(varargin{1});
flds = fields(varargin{1});
Line 373:
Line 374:
end
end
if nargin==1 && isnumeric(cmd)
if nargin==1 && isnumeric(cmd)
+
error('Please also specify acquisition sampling frequency of device that receives the marker');
+
end
+
if nargin > 1 && isnumeric(cmd)
marker = cmd;
marker = cmd;
cmd = 'marker';
cmd = 'marker';
+
Fs = varargin{1};
end
end
Line 388:
Line 393:
case 'marker'
case 'marker'
fwrite(handle, uint8(marker));%IOPort('Write', handle, uint8(marker), 1); % last argument: blocking
fwrite(handle, uint8(marker));%IOPort('Write', handle, uint8(marker), 1); % last argument: blocking
−
WaitSecs(
0.002
);
+
WaitSecs(
2/Fs
);
fwrite(handle, uint8(0));%IOPort('Write', handle, uint8(0), 0); % last argument: blocking
fwrite(handle, uint8(0));%IOPort('Write', handle, uint8(0), 0); % last argument: blocking
return
return
Line 525:
Line 530:
end
end
end
end
−
end</syntaxhighlight>
+
end</syntaxhighlight>
Wiki-admin
Bureaucrats
,
Administrators
1,661
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Help
About
About the TSG
About this Wiki
FAQ
Disclaimer
Survey
Customer Survey
Tools
Special pages
Printable version