-
Notifications
You must be signed in to change notification settings - Fork 0
Useful functions
The OTG toolbox includes a few functions that are typically useful for any Psychtoolbox-based experiment:
-
Fixation cross with
BEC_Fixation
puts a fixation cross on screen of which the visual appearance is controlled in the exp_settings structure. The participant has the opportunity to leave the experiment while the fixation cross is on screen by pressing ESCAPE. -
Monitor a specific keypress with
BEC_WaitForKeyPress
. Enter the name of one or more keys, and the function will only output when the selected key or keys are pressed. It also has an arbitrary timeout time if no keys are pressed for a very long time. -
Show instruction figures with
BEC_InstructionScreens
. You can store instructions in the Stimuli folder saved as .PNG figures. This function creates a screen and puts the slides on screens. You enter either the names of the instructions (as specified in exp_settings) or you simply enter their numbers. Often, you will want to show multiple slides, say slides 5 to 8. This function allows the participant to browse back and forth through these slides with the arrow keys, avoiding that they miss some information when they accidentally press a key before having fully read an instruction.
SeeBEC_Demo_DEER_Multisession.m
for an example of how instructions were shown in a demo experiment. Similarly, the functionBEC_Show_Another_Example.m
asks if you would like to see another example (e.g. of a choice trial), and you can answer yes/no by pressing on the button keys (or by swiping on a tablet). This function is useful in a while-loop that you can break out of once you've seen enough examples. -
Exit the experiment with
BEC_ExitExperiment.m
. When this function is called, data is saved, everything is properly closed (e.g. the Psychtoolbox window) and any plugins are safely disconnected.