-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup_bits.m
93 lines (72 loc) · 2.85 KB
/
setup_bits.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% This script sets up the Bitsi boxes - on for the button boxes, one for the scanner-triggers
% It assumes that there is a SCANNER variable
% SCANNER = {'Skyra','Dummy','Debugging','Keyboard'}; SCANNER = SCANNER{3};
switch SCANNER
case 'Skyra'
%Set WD
cd '/home_local/meduser/Desktop/data/users/inghui/Scarcity Tasks Inge/Main_Experiment/';
%Set trigger
scannertrigger = 97;
%Set output/input comports
bitsiboxScanner = Bitsi('/dev/ttyS2');
bitsiboxButtons = Bitsi('');
bitsiHR = Bitsi('/dev/ttyS1');
% Right hand -- button down
ButtonA = 11; % left
ButtonB = 12; % right
ButtonC = 13; % confirm
ButtonD = KbName('a'); % pauze
ButtonE = KbName('b'); % next
ButtonF = KbName('Escape'); % close
ButtonG = KbName('space');
case 'Dummy'
%Set WD
cd '/home_local/meduser/Desktop/data/users/inghui/MRI Script 2015-01-28/';
%Set trigger
scannertrigger = 97;
%Set output/input comports
bitsiboxScanner = Bitsi('/dev/ttyS2');
bitsiboxButtons = Bitsi('');
bitsiHR = Bitsi('/dev/ttyS1');
% Right hand -- button down
ButtonA = 11; % left
ButtonB = 12; % right
ButtonC = 13; % confirm
ButtonD = KbName('a'); % pauze
ButtonE = KbName('b'); % next
ButtonF = KbName('Escape'); % close
ButtonG = KbName('space');
case {'Debugging', 'Keyboard'}
%Set WD
cd 'M:\Scarcity\Main_Experiment\';
%Set trigger
scannertrigger = KbName('a'); %key "a"
%Set comports to KB
bitsiboxScanner = Bitsi('');
bitsiboxButtons = Bitsi('');
bitsiHR = Bitsi('');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Note: Edit any of letters below, to use the ones you want
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ButtonA = KbName('leftarrow'); % left
ButtonB = KbName('rightarrow'); % right
ButtonC = KbName('return'); % confirm
ButtonD = KbName('a'); % pauze
ButtonE = KbName('b'); % next
ButtonF = KbName('Escape'); % close
case 'buttonbox'
scannertrigger = KbName('a');
bitsiboxScanner = Bitsi('');
bitsiboxButtons = Bitsi('COM1');
% Right hand -- button down
ButtonA = 97; % index finger
ButtonB = 98; % middle finger
ButtonC = 99; % ring finger
ButtonD = 100; % pinky finger
ButtonA_up = 65;
ButtonB_up = 66;
ButtonC_up = 67;
ButtonD_up = 68;
otherwise
disp('Missing proper value for "SCANNER" variable. Cannot set up Bitsi-boxes properly..');
end