Hi all!
I am new to PsychToolbox (I migrated from Cogent). Could someone please tell me how to wait for the MRI trigger to synchronise visual presentation using DataPixx and ResponsePixx in Matlab?
Whether here or by email [v.rodriguez@aston.ac.cuk] I will be very grateful.
This also depends on what type of trigger the MRI is sending out. Several scanners I’ve worked with use a keyboard signal and so you need to use e.g. KbCheck in a loop to wait for the character before starting:
PsychDefaultSetup(2);
KbCheck(-1); %make sure KbCheck is loaded into memory
trigger = KbName('s'); %MRI sends the 's' key
while true
WaitSecs(0.001); % wait 1ms between checks
[pressed, ~, key] = KbCheck(-1);
if pressed && key(trigger); break; end
end
% your draw code here...