It can be useful to use your MacBook Pro for stimulus presentation instead of the normal windows based presentation machine. Together with Psychtoolbox this offers the possibility to implement complex experimental designs while maintaining reasonably accurate control of stimulus timing.
In order to make use of this setup:
Within Matlab you can send trigger events to the acquisition machine as follows:
delete(instrfind);
serobjw = serial('/dev/tty.PL2303-00001004'); % Creating serial port object via the keyspan
serobjw.Baudrate = 115200; % Set the baud rate at the specific value
set(serobjw, 'Parity', 'none'); % Set parity as none
set(serobjw, 'Databits', 8); % set the number of data bits
set(serobjw, 'StopBits', 1); % set number of stop bits as 1
set(serobjw, 'Terminator', ''); % set the terminator value to newline
set(serobjw, 'OutputBufferSize', 512); % Buffer for write
fopen(serobjw);
fwrite(serobjw,100); % send trigger 100 to acquisition machine
fclose(serobjw);
The important bit here is to create a serial device which makes use of the keyspan device.
Share this page: