Hi Vik,
Bonsai integration now uses PsychToolbox pnet instead of , on the 'develop' branch of the Bpod_Gen2 repository here.
You'll need to remove your existing Bpod installation from the MATLAB path and add the new one.
The correct startup sequence for the example code is:
-In Bonsai, open the example Bonsai workflow here but don't start it yet
-In MATLAB, open the Bonsai socket configurator from the settings menu
-Click 'connect'. The 'Bonsai Status' display should turn yellow.
-Switch back to Bonsai, and press the green button to start the workflow.
-Switch back to MATLAB. The 'Bonsai Status' display should have green text: 'Connected'.
-Run the 'SoftCodeTriggeredStateChange' example code here.
-At the MATLAB command prompt, run SendStateMachine(sma);
-Place a flashlight in the left half of your webcam's view field (you should have a fairly dark background compared to the light)
-At the MATLAB command prompt, run RawEvents = RunStateMachine
-The left port should be lit, and the state machine's status indicator should be orange (running a trial)
-Move the flashlight to the opposite side of the webcam view.
-You should see the lit port change from 1 to 3, and the state machine ends the trial.
Please let me know if this works!
Thanks,
-Josh