I am stuck with a problem related with sending triggers through serial port and I would be truly grateful if anyone could give any help / advice:
OS : Win 10
PsychoPy version : 1.90.1
What are you trying to achieve?:
I want to send triggers from a testing laptop to an EEG laptop.
The aim is to mark on the EEG trace the moment when a sound is presented, in order to subsequently analyse event-related potentials.
I am using Biosemi EEG system for EEG data collection.
I am using Biosemi USB trigger interface cable - which is recognized as a serial port https://www.biosemi.com/faq/USB%20Trigger%20interface%20cable.htm) for sending triggers from testing “Psychopy” laptop to EEG laptop.
Please find below an overview of the experiment / flow (simplified version for the purposes of solving the trigger issue):
I want to send a marker whenever sound_1 is presented.
Because I am not using a parallel port nor LabJack, I cannot use Builder’s I/O.
Therefore I introduced a code component as follows:
I want to present 3 different types of sounds, one sound per trial, in n trials.
I have 4 different conditions, which differ basically in the proportion of sound types.
I am presenting visual info at the same time.
I have defined the conditions/trials in an excel file (looptrials file) and the order of the conditions in another excel file (loopblocks file).
In the looptrials file I have 1 column identifying the type of sound as 0, 1 or 2. This column is named typesoundfile1.
With ‘‘port.write(b’$typesoundfile1’)’’ I mean that I want to send the number from column “typesoundfile1” corresponding to the trial row.
The good thing is that:
- There are triggers being sent every 5 seconds to the EEG trace.
The problems are:
- The EEG laptop is receiving multiple types of triggers, but without any type of relationship with the numbers 0,1 and 2 present on column “typesoundfile1”: i.e. the numbers are different from 0,1 and 2 and vary independently from sound type.
While debugging this I have noticed that ‘‘port.write(b’1’)’’ sends the number 49 to the EEG. I have played around a bit to try finding a way to send 0, 1 and 2 but so far I have been unsuccessful…
I am also not sure about the most appropriate way to send trial-specific triggers based on info from an excel file…
Can anyone give some advice? Many thanks!!