Digital I/O Demo 6 -- Configuring labels for RESPONSEPixx digital input ================================================================================== This MATLAB demo allows the user to create a .csv lookup table which stores custom button labels and their corresponding 24- and 16-bit digital input values. These digital input values are the codes received by the getDinValue (24 bit), DinSchedule (24 bit) and DinLog (16 bit) features on your VPixx I/O hub. Once it is created, the lookup table can be used in your experiment script to convert these recorded values into button names. You can save as many custom button lookup tables as required. .. image:: RPxTable.png :width: 500 :align: center After you record your button labels, you can optionally run a test to ensure the inputs were labelled correctly. This test is also a demonstration of the DinLog, which continuously checks the state of the digital inputs, but only records state changes and the time they occurred. This information is saved on the I/O controller's onboard memory, starting from an address specified by ``SetDinLog`` (the default address is 12e6). The DinLog is a useful way to record button presses without taking up much memory. By contrast, the DinSchedule continuously records the state of the digital input and can quickly fill a small data buffer. In this test, every 250 milliseconds we check the I/O controller to see if there is any new data in our DinLog. If so, we send that data back to the computer and compare it to our lookup table. If the code is in the lookup table, we report the button's name and the time it was pressed. If the code is not in our table, we report it as "unregistered button or button combination." .. Tip:: Combinations of button presses yield unique digital input codes. If you have a label for "Blue" and "Green", but no label for the combination, then simultaneously pressing both of these buttons will produce an "unregistered button" response. .. literalinclude:: ../DatapixxToolbox/DatapixxDemos/RPxSetButtonConfiguration.m :language: matlab :emphasize-lines: 46, 66, 88, 149-152, 160-161, 170, 212 :linenos: