In the same way that a variable is being used to alter the presented stimulus on each loop repetition based on the Conditions file (“stimulusitem”), I would like to be able to transmit the corresponding value of another variable/parameter (“stimuluscode”). However, $stimuluscode doesn’t work in the Code component and a number of other things I’ve tried (based on various threads and discussions here and elsewhere) haven’t worked either.
This is in the Begin Experiment tab…
import serial ser = serial.Serial('COM4', 9600, timeout=1)
And I’m using ser.write() to define the value to be sent. Ideally, it would just be ser.write($stimuluscode), but alas, it is not. I’ve looked around this forum and the wider interweb, but nothing I’ve tried has worked yet. My inkling is that I can’t directly access the conditions file values from Code without importing the contents of that conditions file in the code. My attempts to do this have failed too though.
Any help would be massively appreciated.