Python library for interfacing with Cedrus XID devices, e.g. StimTracker, Riponda, RB-x40, c-pod, and Lumina.
Project description
Python library for communicating with all Cedrus XID devices: StimTracker, RB-x40 response pads, c-pod, Lumina, and SV-1.
XID (eXperiment Interface Device) devices are used with software such as SuperLab, Presentation, and E-Prime for receiving input as part of stimulus/response testing experiments. This handles all of the low level device handling for XID devices in python projects.
Minimal samples for collecting responses and sending event markers are available in the Git repo.
Response collection in pyxid
When a physical key is pressed on the device, a set of bytes describing it go into the serial buffer. This also occurs when the physical key is released. Calling poll_for_response() makes pyxid check the serial buffer for bytes constituting a response packet, and put a response object in its internal response queue. It does so once per poll_for_response() call. Calling get_next_response() pops a single response from the response queue. If you want to avoid seeing more responses than necessary, you can use flush_serial_buffer() to prevent more responses from being added to the queue by poll_for_response(), and you can clear already processed responses with clear_response_queue().
The response object is a python dict with the following keys:
port: Device port the response was from (typically 0)
key: Response pad key pressed by the subject
pressed: True if the key was pressed, False if it was released
time: value of the Response Time timer when the key was pressed/released
For an example see sample/responses.py
Sending a TTL pulse signal via the library can be done via the following methods:
set_pulse_duration()
activate_line()
clear_line()
clear_all_lines()
For an example see sample/event_markers.py
Timers
Each XID device has an internal timer. This timer can be reset via reset_timer() or automatically on the onset of a light sensor or onset of audio. It's commonplace to reset the timer at the start of the experiment and/or at the onset of a simulus.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyxid2-1.0.7.tar.gz
.
File metadata
- Download URL: pyxid2-1.0.7.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a302ba0dce495884a80fcf68ccc12f1214ec7864888912ecf78333077e84882b |
|
MD5 | 15347cfebe1499a49b07f384f7c1c774 |
|
BLAKE2b-256 | 3be8c3cf012a1bf0c6fb0ebc71f2eb5bf1241dca086db47e80ecbdf8a9c1bc8e |
File details
Details for the file pyxid2-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: pyxid2-1.0.7-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 630617adc9d4757e65c7e8aafab988bae85af9ad6867312fb519798a0d9a6d5a |
|
MD5 | 20d0651f6d31676a47f739151489b301 |
|
BLAKE2b-256 | ecf187a3ee0f222cb2b2cb888750dccef07ec2ef3e69207e6e3f9206fdb4a42b |