I want to turn on the LED and deliver water simultaneously after the ITI period, but the two states last for different durations. How can I achieve this?
sma = NewStateMachine();
sma = AddState(sma, 'Name', 'ITI', ...
'Timer', 3, ...
'StateChangeConditions', {'Tup', 'LEDCue'}, ...
'OutputActions', {});
sma = AddState(sma, 'Name', 'LEDCue', ...
'Timer', 0.2, ...
'StateChangeConditions', {'Tup', 'DeliverWater'}, ...
'OutputActions', {'LED', 4});
sma = AddState(sma, 'Name', 'DeliverWater', ...
'Timer', 0.1, ...
'StateChangeConditions', {'Tup', 'Reward'}, ...
'OutputActions', portOutput);
sma = AddState(sma, 'Name', 'Reward', ...
'Timer', 3, ...
'StateChangeConditions', {'Tup', 'exit'}, ... % Tup {'Port1Out', 'ITI'}
'OutputActions', {});