If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): macOS Mojave version 10.14
PsychoPy version (e.g. 1.84.x): v2020.2.4
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: I want the duration of picture stimulus and the isi(inter-stimulus-interval) to be fixed as 2 seconds, but the picture will disappear as soon as the key is pressed, so it means that the duration of isi need to be modified.
**What did you try to make it work?:**I’m using a builder+code component. I make 2 routines, 1 for picture presentation, 1 for isi. the picture stimulus routine was “force end of routine” by a keyboard component, while the duration of isi is a variable named dura_c1_iti1, I calculate dura_c1_iti1 by the following code component inserted in the beginning of isi routine:
start_c1_enc1 = c1_enc_l1Clock.getTime()
start_c1_iti1 = c1_iti1Clock.getTime()
dura_c1_iti1 = 2-(start_c1_iti1 - start_c1_enc1)
the c1_enc_l1 is the routine name of picture stimulus, c1_iti1 is the routine name of isi routine, I want dura_c1_iti1(the duration of isi) to be the 2 seconds - (the start time of isi routine - the start time of picture routine)
**What specifically went wrong when you tried that?:**but I found the recorded dura_c1_iti1 is a negative value, which confused me a lotttt
Looking forward to your help, I appreciate it very much! thank you!
Include pasted full error message if possible. “That didn’t work” is not enough information.