Analog I/O Demo 1 -- How to acquire data on the analog IO port ================================================================================== .. Note:: You can only use ADC/DAC with the full version of a device; the lite version does not have ADC/DAC capabilities. This example explains how to start the acquisition of data on the Analogue port. To simulate a real experiment, the acquisition starts on a video sync, such as, for example, when a stimulus would be shown and your subject would start reacting. In this demo, the stimulus is simply a full white screen for a duration of exactly one frame (8.33 ms). The demo records on the analogue port, at a rate we chose. To determine this rate, we create a schedule. When defining the schedule, we must decide which port we want to monitor, and at what speed (rate). ``Datapixx('SetAdcSchedule', 0, 1e4, nAdcSamples, [0 1]);`` The 0 is the delay parameter. Since we will start this ourselves, we set it to 0. We set the rate to 10000 and since we specify no units, this is 10000 Hz, or 10 kHz. nAdcSamples is the number of samples before the schedule start. Set it to zero if you want to stop it manually. [0 1] are the channels we are going to monitor. In this example, we use a ``loopback`` to create and read Analogue signals. In a real experiment, you would instead have a device sending the analogue signal, and would therefore not use the ``loopback``. .. literalinclude:: ../DatapixxToolbox/DatapixxDemos/DatapixxAdcAcquireDemo.m :language: matlab :emphasize-lines: 40, 41, 84 :linenos: