I had a question about creating a looped routine that chooses the trial type using an Excel file. I need the trial type to be chosen randomly without replacement which I achieve by using the the ‘random’ loop type. There are 8 CS+ and 8 CS- Trial types. The nature of my experiment requires us to have no more than 3 CS+ types in a row so is there a way to code in the builder view that will prevent PsychoPy from choosing 4 CS+ types in a row?
The code looks like this;
d.getFeedback(u3.BitStateWrite(smell,1)) #open a valve
d.getFeedback(u3.BitStateWrite(12,1)) #close NO
‘smell’ is defined in the Excel file. There are 16 rows; eight of which are CS+ and CS-.