Hi Taylor,
Thanks for sharing your code.
Certainly, you can’t turn the laser on before the update_display
and wait. The delay_stim_onset
stimulus is what tells you how long to wait before turning the laser on. The right place to turn the laser on is immediately after the wait
at line 634 in your code.
Also, what does the turn_laser_on
macro do? Does it still use Pulse Variable to turn the laser on and off? As I explained in our previous discussion, it’s going to be hard to get the timing right that way. Instead, you should be setting the laser gate signal high and low directly in the protocol, as I demonstrated in my previous example code.
Regarding the errors: The problem is that the if_else component can only contain if and else components. Starting at lines 631 and 655, you’ve put a bunch of actions other than if
and else
directly inside the if_else
, which isn’t allowed. If you move each set of actions in to the if
or else
that precedes it (which I think was your intention), then things should work.
Cheers,
Chris