If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 2021.1.1.4
Standard Standalone? (y/n) If not then what?:
I am trying to send triggers to my EEG system. I am using the brain vision achiChamp amplifier and the goal is to send triggers whenever an auditory stimulus started playing. As I must use the serial port to send triggers to the trigger box I have used this code which I found here in Psychopy forum:
Connected = True
PulseWidth = 0.01
if port.inWaiting() > 0:
port = serial.Serial(“COM6”)
thread = threading.Thread(target=ReadThread, args=(port,))
Connected = False
However, when I use port.write() command nothing is sent to the EEG system. I tried to just set the port high and low by using port.setDTR(True) and it works. But by using this command, I am not able to send different triggers, and the only way to differentiate triggers for different stimuli is the time interval between setting high and low.
Now I am wondering why in my system the serial port.write() command is not working but port.setDTR() works. I should also mention that the computer which is used for sending triggers is connected through a USB port and a USB to serial converter to the trigger box. I am not sure if that is the problem.
I would be more than happy if anyone can help me.