|
Main /
PsychToolboxMatlabPsychToolbox Homepage Writing and Reading from parallel ports with Matlab psychtoolbox: Psychtoolbox Wiki Additional Instructions PortTalk download (this is already installed on the STIM pc) %MATLAB example %PC stim port definition PCport1 = hex2dec('378'); % &H378 % 888 PCport2 = hex2dec('BCE1'); % &HBCE1 % 48353 PCport3 = hex2dec('BCF1'); % &HBCF1 % 48369 %SEND triggers (e.g. from 1 to 255) %open the acquisition software and look at the triggers on the %STI00X lines and STI101 for i = 1:255 lptwrite(PCport1, i); % send trigger WaitSecs(0.005); % wait 5 ms lptwrite(PCport1, 0); % reset port end %CHECK button presses respkey = 0; while respkey == 0; respkey =lptread(1+PCport1); end |