Using KbQueue to automoatically send triggers to parallel port

Hi All,

I am using PTB3 on Matlab on Ubuntu 14.04 (via the neurodebian repo)

I am presenting EEG experiments, accessing the parallel port via the pp.m and associate mex file.

It's a visual experiment with rapidly flickering images (60Hz), so for a period of a few seconds, the scren is flipping every fraction of a second. As stimuli are still flickering on screen, the participants register a response.

I monitor keyboard activity using the KbQueue functions. I start the queue at the beginning of each trial and then flush it at the end. Up until now I have back after the experiment to insert responses into the marker file of the EEG from the behavioural files output in Matlab. But I was wondering if there's any way that a trigger can be automotically sent to the port as soon as a button is pressed? I'd rather not periodically check the Queue as it increases processing demands and wouldn't give good precision.

Thanks for any help,
Neil.


No, such functionality is not implementd atm, so you will need to poll the KbQueue. You could use async flips, e.g., AsyncFlipTest.m, if you want to do polling while a flip is still pending, so you are not limited to the 60 Hz polling rate.

However, as long as you use regular keyboards or mice for collecting responses, the timing precision of the keyboard/mouse hardware is usually not better than those 16 msecs anyway - the USB sampling runs at 8 msecs / 120 Hz, and the keyboard/mouse hardware itself is usually much worse in timing resolution than those 8 msecs, more like 20 - 80 msecs. So trying to get better than those 60 Hz with normal keyboards/mice won't give you a better precision anyway, only possibly the illusion of better precision.

-mario