Written for Poirazi Lab
See HERE for me info on the Bpod
- MATLAB 2018a (or newer)
- Install psychtoolbox library
- For Windows
- Go to http://psychtoolbox.org/download#Windows (they have detailed instructions)
- You download Psychtoolbox installer as written in Psychtoolbox-3; step 2
- Create a folder “toolbox” under
C:\
and extractDownloadPsychtoolbox.m
zip folder here (you should end up withC:\toolbox\DownloadPsychtoolbox.m
) - Download gStreamer as written in Psychtoolbox-3; step 3
- Download TortoiseSVN from here
- Run MATLAB as Administrator (you can go to
C:\Program Files\MATLAB\R2018a\bin
and right click tomatlab.exe
file - In MATLAB command line:
>> cd('C:\toolbox\') >> DownloadPsychtoolbox('C:\toolbox')
- A folder
Psychtoolbox
will be created underC:\toolbox\
- A folder
- For linux
- Go to http://psychtoolbox.org/download.html#Linux
- Their instructions should be enough
- For Windows
- Install python (Suggested version == 3.7)
- verify installation before proceeding
- Install pip (https://phoenixnap.com/kb/install-pip-windows) (steps 1-3)
- Copy and paste in command prompt to install the necesary libraries:
pip install numpy scipy matplotlib pandas scikit-learn statsmodels colour click
- If you'll do random dots experiments, then you'll need Psychopy as well
pip install Psychopy
-
Download/unzip the Bpod software (from wetlab drive:
software/Bpod_Gen2_live.zip
) underC:
-
Download/unzip the Bpod protocols/files (from wetlab drive:
software/BpodUser
) underC:
- Replace the files in
BpodUser/Protocols/Mouse2AFC
with the files from this repo - This repo will have a more up to date version than the one in the
C:
drive - As of writing this the most up to date version is named
Mouse2AFC_2023_01_13
- Replace the files in
-
Install Arduino software for your OS
Then open MATLAB → go to SetPath (in the environment panel)→
- Import all files from
Bpod_Gen2_live
: click to add with subfolders and chose theBpod_Gen2_live
folder andSAVE
- Import all files from toolbox (Psychtoolbox): click to add with subfolders and chose the
Psychtoolbox
folder andSAVE
- NOTE: Move the folderC:\toolbox\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\
before (up) the folderC:\toolbox\Psychtoolbox\PsychBasic\
andSAVE
. - Import all files from
BpodUser/Protocols/Mouse2AFC/Definitions
folder andSAVE
- As state previously, right now
Mouse2AFC
is namedMouse2AFC_2023_01_13
- As state previously, right now
- Import all files from
BpodUser/Settings_Bpod2
folder andSAVE
- import all files from the
MATLAB
folder in this repo andSAVE
Open Arduino software and
- Connect Arduino to PC using the programming port (not native port)
- Use the programming port to upload to the arduino and native port when running Bpod
- Go to tools --> board --> board manager and search
arduino due
- Select
Arduino Sam Boards(32-bits ARM Cortex-M3)
and install the package - Upload the files found here to the arduino
-
Connect arduino to PC using the native port
-
Open MATLAB
-
Open arduino software
-
In tools, under Boards select the Native Port and under Port select the port (i.e. 'COM4' for Windows)
-
In MATLAB command line:
Bpod('COM4')
To start Bpod
- Mouse2AFC: Line 63
createMMFile('c:\Bpoduser\', 'mmap_matlab_randomdot.dat', file_size);
Change c:\Bpoduser\
to reflect your system path to mmap_matlab_randomdot.dat
- BpodObject: Line 116
obj.Path.LocalDir = 'C:\BpodUser'; %fullfile(obj.Path.ParentDir, 'BpodUser');
Delete `C:\BpodUser' and uncomment the rest of the line