if expInfo['Device'] == 'Bits#': bits = crs.BitsSharp(win, mode='bits++', checkConfigLevel=1) if expInfo['Device'] == 'Display++' or expInfo['Device'] == 'None': if expInfo['Touch screen'] == "Yes": if expInfo['Device'] == 'Display++': bits = crs.DisplayPlusPlusTouch(win, mode='bits++', checkConfigLevel=1) else: bits = crs.DisplayPlusPlusTouch(win, mode='bits++', checkConfigLevel=1, noComms=True) else: if expInfo['Device'] == 'Display++': bits = crs.DisplayPlusPlus(win, mode='bits++', checkConfigLevel=1) else: bits = crs.DisplayPlusPlus(win, mode='bits++', checkConfigLevel=1, noComms=True) #=======================================================================================# # If Bits# or Display++ initialise the device. # # This can also be done via parameter setters but this illustrates the low level send # # comands. # if expInfo['Device'] != 'Bits++': #bits = crs.BitsSharp(win, mode='bits++') #gamma.setGamma(win.winHandle._dc, 1.0, 1) bits.sendMessage('$TemporalDithering=[ON]\r') bits.read(timeout=0.1)
from psychopy.visual import gamma from psychopy.hardware import crs from scipy import misc mon=monitors.Monitor(expInfo['Monitor'],distance=56) print("open CRS") if expInfo['Device']=='Bits++': bits = crs.BitsPlusPlus(win, mode='bits++',rampType=1, frameRate=120) if expInfo['Device']=='Bits#': bits = crs.BitsSharp(win, mode='bits++',checkConfigLevel=1) if expInfo['Device']=='Display++': if expInfo['Touch screen']=="Yes": bits = crs.DisplayPlusPlusTouch(win, mode='bits++',checkConfigLevel=1) else: bits = crs.DisplayPlusPlus(win, mode='bits++',checkConfigLevel=1) if expInfo['Device'] != 'Bits++': if bits.noComms: sys.exit #bits = crs.BitsSharp(win, mode='bits++') #gamma.setGamma(win.winHandle._dc, 1.0, 1) bits.sendMessage('$TemporalDithering=[ON]\r') bits.read(timeout=0.1) bits.sendMessage('$VideoFrameRate\r') bits.read(timeout=0.1) bits.sendMessage('$enableGammaCorrection=[invGammaPF225fA.txt]\r') bits.read(timeout=0.1) bits.sendMessage('$EnableTouchScreen=[OFF]\e') bits.read(timeout=0.1) bits.sendMessage('$Stop\r')