Hi Josh,
I have some problems with connecting bonsai to bpod. Bonsai was set to send '5' by softcode to bpod to trigger water once mouse reentered a specific area.
1) the number of 'softcode' is not stable after reopening Matlab and reconnecting bonsai. Sometimes, 'softcode1' event was detected in bpod while 'softcode6' event was detected in other times. Generally, how to receive any type of data (like float) in bpod besides integer? I found 'ReadOscByte.m' in bpod, but have no idea how to use it during running state machine.
2) Is it doable to run two Bpod (opening two Matlab programs) and bonsai programs at the same time and connect the two pairs using different ports? Will the 'softcode' data stream interfere with each other between different pairs of bonsai-bpod?
sma = AddState(sma, 'Name', 'DetectStay', ...
'Timer', 0, ...
'StateChangeConditions', {'SoftCode6', 'OpenTube'}, ...
'OutputActions', {});
sma = AddState(sma, 'Name', 'OpenTube', ...
'Timer', RewardAmount, ...
'StateChangeConditions', {'Tup', 'exit'}, ...
'OutputActions', openSpout);
Thanks,
Lei