biac:experimentalcontrol:biac6hardware
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
biac:experimentalcontrol:biac6hardware [2024/04/15 19:23] – [BIAC6 Screen Configuration] cmp12 | biac:experimentalcontrol:biac6hardware [2024/04/15 19:49] – [BIAC6 Screen Configuration] cmp12 | ||
---|---|---|---|
Line 127: | Line 127: | ||
A **CLONED** configuration with goggles off, will result in a single monitor to programs like PsychToolbox and PsychoPy. | A **CLONED** configuration with goggles off, will result in a single monitor to programs like PsychToolbox and PsychoPy. | ||
+ | PTB: | ||
<code matlab> | <code matlab> | ||
Line 135: | Line 136: | ||
</ | </ | ||
+ | |||
+ | PsychoPy: | ||
+ | <code python> | ||
+ | |||
+ | import pyglet | ||
+ | |||
+ | display = pyglet.canvas.get_display() | ||
+ | screens = display.get_screens() | ||
+ | screens | ||
+ | >> | ||
+ | |||
+ | # screens[0] is the one and only screen | ||
+ | |||
+ | </ | ||
+ | |||
Any **EXTENDED** configuration will result in multiple monitors being available | Any **EXTENDED** configuration will result in multiple monitors being available | ||
+ | PTB: | ||
<code matlab> | <code matlab> | ||
Line 152: | Line 169: | ||
</ | </ | ||
- | + | PsychoPy: | |
- | For instance | + | |
<code python> | <code python> | ||
Line 160: | Line 176: | ||
display = pyglet.canvas.get_display() | display = pyglet.canvas.get_display() | ||
screens = display.get_screens() | screens = display.get_screens() | ||
- | screenNum | + | screens |
- | #get resolution of screen | + | >> |
- | win_res | + | |
- | #set the output to always go to screen | + | # screens[0] is the first screen |
- | win = visual.Window(size=win_res, | + | # |
- | fullscr=True, | + | |
- | color=(0.2, 0.2, 0.2)) | + | |
- | + | ||
- | msg1 = visual.TextStim(win, | + | |
- | msg1.draw() #draw it | + | |
- | win.flip() #put it on the screen | + | |
- | core.wait(5) #wait 5 seconds | + | |
- | win.close() #close it | + | |
- | core.quit() #stop | + | |
</ | </ | ||
- | |||
- | matlab PTB the first screen would be #1 ( matlab is indexed starting at 1 instead of 0 ). | ||
- | <code matlab> | ||
- | |||
- | %configure the first screen is psychtoolbox | ||
- | screenNumber = 1; | ||
- | [Window, | ||
- | |||
- | |||
- | </ | ||
- | |||
- | |||
biac/experimentalcontrol/biac6hardware.txt · Last modified: 2024/06/21 15:44 by 127.0.0.1