-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgiveReward.m
More file actions
25 lines (16 loc) · 777 Bytes
/
giveReward.m
File metadata and controls
25 lines (16 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function runInfo = giveReward(expInfo, runInfo, hwInfo, rigInfo)
if strcmp(runInfo.rewardStartT.Running, 'off') ...
&& strcmp(runInfo.STOPrewardStopT.Running,'off')...
&& strcmp(runInfo.BASErewardStopT.Running,'off')
VRmessage = sprintf('Reward given at trial %d, frame %d',...
runInfo.currTrial,runInfo.flipIdx);
fprintf([VRmessage,'\n']);
VRLogMessage(expInfo, VRmessage);
if rigInfo.useAnalogRewardValve
hwInfo.rewVal.deliverBackground(expInfo.rewardSize, 'ul');
runInfo.totalValveOpenTime = runInfo.totalValveOpenTime + expInfo.rewardSize;
else
hwInfo.rewVal.activateDigitalDelivery();
runInfo.totalValveOpenTime = runInfo.totalValveOpenTime + rigInfo.BASEvalveTime;
end
end