Skip to content

Commit 0c82bfa

Browse files
committed
update readme
1 parent badac0c commit 0c82bfa

File tree

1 file changed

+59
-6
lines changed

1 file changed

+59
-6
lines changed

README.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,57 @@ The exact version required for this to work but it is known to work with:
2727

2828
We use the `camelCase` to more easily differentiates our functions from the ones from PTB that use a `PascalCase`.
2929

30+
We keep the McCabe complexity as reported by the [check_my_code function](https://github.com/Remi-Gau/matlab_checkcode) below 15.
31+
32+
## How to install
33+
34+
35+
36+
3037
## Structure and function details
3138

32-
### setParameters
39+
<!-- ### setParameters -->
3340

3441
### initPTB
3542

43+
This will initialize PsychToolBox
44+
- screen
45+
- the windon opened takes the whole screen by default
46+
- set in debug mode with window transparency if necessary
47+
- can skip synch test if you ask for it (nicely)
48+
- gets the flip interval
49+
- computes the pixel per degree of visual angle
50+
- set font details
51+
- keyboard
52+
- sound
53+
54+
### testKeyboards
55+
Checks that the keyboards asked for properly connected.
56+
57+
If no key is pressed on the correct keyboard after the timeOut time this exits with an error.
58+
59+
### cleanUp
60+
A wrapper function to close all windows, ports, show mouse cursor, close keyboard queues
61+
and give access back to the keyboards.
62+
3663
### getResponse
37-
It is wrapper function to use KbQueue which is definitely what you should used to collect responses.
64+
65+
It is wrapper function to use `KbQueue` which is definitely what you should used to collect responses.
3866

3967
You can easily collect responses while running some other code at the same time.
4068

41-
It will only take responses from the `response box` which can simply be the "main keyboard" or another keyboard connected to the computer or the response box that the participant is using.
69+
It will only take responses from the `response box` which can simply be the "main keyboard" or
70+
another keyboard connected to the computer or the response box that the participant is using.
4271

43-
You can use it in a way so that it only takes responses from certain keys.
72+
You can use it in a way so that it only takes responses from certain keys and ignore others (like
73+
the triggers from an MRI scanner).
4474

4575
If you want to know more on how to use it check its help section and the `CPP_getResponseDemo.m`.
4676

47-
To select a specific keyboard to be used by experimenter/participant, you need to know the assigned MATLAB value. To copy-paste this on the command wuindow:
77+
To select a specific keyboard to be used by the experimenter or the participant, you need to know
78+
the value assigned by PTB to each keyboard device.
79+
80+
To know this copy-paste this on the command window:
4881

4982
```
5083
[keyboardNumbers, keyboardNames] = GetKeyboardIndices;
@@ -53,8 +86,28 @@ keyboardNumbers
5386
keyboardNames
5487
```
5588

89+
### deg2Pix
90+
91+
For a given field value in degrees of visual angle in the input `structure`,
92+
this computes its value in pixel using the pixel per degree value of the `cfg` structure
93+
and returns a structure with an additional field with Pix suffix holding that new value.
94+
95+
### drawFixationCross
96+
97+
Define the parameters of the fixation cross in `cfg` and `expParameters` and this does the rest.
98+
99+
### pressSpace4me
100+
101+
Use that to stop your script and only restart when the space bar is pressed.
102+
103+
104+
105+
106+
107+
108+
109+
56110

57-
### cleanUp
58111

59112
## Contributors ✨
60113

0 commit comments

Comments
 (0)