Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Serial port

Hello,
I try to send 1 byte via serial port using inline_script (python). I would to trigger this script after keyboard response and only for specific stimuli. So, I place a "run if" [var]="yes" associated with another variable in the first sketchpad.
I have a first script in the beginning of my experiment

import serial
ser = serial.Serial ("COM5", 9600)

And my second script, after keyboard response is :

ser.write ('0')
print (ser)
ser.close

The most minimalist codes of the world! But when I launch opensesame, it cratches only when stimuli associated by var "yes" arrive.
Do you have ideas my friends?

Comments

Sign In or Register to comment.