forked from tsgouvea/TaskMatching
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSoftCodeHandler.m
More file actions
21 lines (19 loc) · 870 Bytes
/
SoftCodeHandler.m
File metadata and controls
21 lines (19 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function SoftCodeHandler(softCode)
%soft codes 1-10 reserved for odor delivery
%soft code 11-20 reserved for PulsePal sound delivery
global BpodSystem
if ~BpodSystem.EmulatorMode
if softCode == 1 %noise on chan 1
SendCustomPulseTrain(1,cumsum(randi(9,1,601))/10000,(rand(1,601)-.5)*3); % White(?) noise on channel 1+2
SendCustomPulseTrain(2,cumsum(randi(9,1,601))/10000,(rand(1,601)-.5)*3);
TriggerPulsePal(1,2);
elseif softCode == 2 %beep on chan 2
SendCustomPulseTrain(2,0:.001:.3,(ones(1,301)*.5)); % Beep on channel 1+2
SendCustomPulseTrain(1,0:.001:.3,(ones(1,301)*.5));
TriggerPulsePal(1,2);
elseif softCode == 3 %
SendCustomPulseTrain(2,0:.0007:.3,(ones(1,429)*.5)); % Beep on channel 1+2
SendCustomPulseTrain(1,0:.0007:.3,(ones(1,429)*.5));
TriggerPulsePal(1,2);
end
end