TRACKPixx /Mini Demo 1 -- Recording eye tracking data with the TRACKPixx /Mini ======================================================================================= .. Note:: This demo requires TRACKPixx Revision 16 or later. You can check for recent firmware updates at vpixx.com/whatsnew In this demo we record the eye position data from the TRACKPixx Mini for 4 seconds, and then plot the result. We capture images of the eye and display them on the screen to ensure the camera is positioned well. We then display a series of squares for the subject to fixate. Recording of eye movements starts when the "Enter" key is pressed, and continues for 4 seconds. On the TRACKPixx Mini, we read tracker data directly from the device using ``Datapixx('ReadTPxMiniData')`` and save it to an array. TRACKPixx Mini data has the following format: Timetag, Left Eye X, Left Eye Y, Left Pupil Diameter, Right Eye X, Right Eye Y, Right Pupil Diameter, Digital Input Values (24 bits), Left Blink Detection, Right Blink Detection, Digital Output Values (24 bits), Left Eye Fixation Flag, Right Eye Fixation Flag, Left Eye Saccade Flag, Right Eye Saccade Flag, Message code, Left Eye Raw X, Left Eye Raw Y, Right Eye Raw X, Right Eye Raw Y. As a last step we generate 4 figures. The first 3 figures plot X and Y position over time for the left eye, the right eye, and both eyes. The last figure plots left and right pupil diameter over time. Data points where the X and Y positions equal 9000 are frames in which the eye position was lost (i.e., the participant blinked). .. literalinclude:: ../DatapixxToolbox/DatapixxDemos/TPxMiniRawRecordAndPlot.m :language: matlab :linenos: