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
I specify: crach arrive after 3 presentations...
Hi guipru,
You can't use a variable named var as var is the name of the variable object.
So you could use and inline with
var.somename='yes'and a Run if with[somename]='yes'for example.Hope this helps.
Best,
Jarik