# BioSemi USB Trigger Interface with PsychToolBox on Linux

**URL:** <https://psychtoolbox.discourse.group/t/biosemi-usb-trigger-interface-with-psychtoolbox-on-linux/4292>\
**Category:** Hardware\
**Tags:** linux, io\
**Created:** [March 5, 2022, 5:12am UTC](https://psychtoolbox.discourse.group/t/biosemi-usb-trigger-interface-with-psychtoolbox-on-linux/4292 "2022-03-05T05:12:09Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Ian-Max-Andolina](https://yyz2.discourse-cdn.com/free1/user_avatar/psychtoolbox.discourse.group/ian-max-andolina/32/4_2.png) [@Ian-Max-Andolina](https://psychtoolbox.discourse.group/u/Ian-Max-Andolina)\
**Post date:** [March 12, 2022, 4:29pm UTC](https://psychtoolbox.discourse.group/t/biosemi-usb-trigger-interface-with-psychtoolbox-on-linux/4292/6 "2022-03-12T16:29:40Z")

</div>

If you use the LabJack T4, then they use a unified LJM API and the same code works well cross-platform. I use the T4’s very cool ability to run code (it has a Lua runtime and can run a command-response server), so that I can send commands asynchronously from PTB and let the LabJack deal with any timing (for example if one uses a variable-length TTL to control a reward system). See the details on the wiki:

> **[LabJack · Psychtoolbox-3/Psychtoolbox-3 Wiki](https://github.com/Psychtoolbox-3/Psychtoolbox-3/wiki/LabJack)**
>
> Psychophysics Toolbox Version 3 (PTB-3) is a free set of Matlab and GNU Octave functions for vision and neuroscience research. - LabJack · Psychtoolbox-3/Psychtoolbox-3 Wiki

For the LabJack U3/U6 they use the exodriver on Linux/macOS and I also share some code for that, but on Windows they use a different driver and I never bothered to work out how to access it.

I assume that an Arduino would also work just as well and would be cross-platform, and I have some code to handle that too:

> **[Arduino · Psychtoolbox-3/Psychtoolbox-3 Wiki](https://github.com/Psychtoolbox-3/Psychtoolbox-3/wiki/Arduino)**
>
> Psychophysics Toolbox Version 3 (PTB-3) is a free set of Matlab and GNU Octave functions for vision and neuroscience research. - Arduino · Psychtoolbox-3/Psychtoolbox-3 Wiki

I found super fast and low variability command-response times with PTB’s IOPort and the legacy hardware interface from Mathworks: [Serial port interface code -- a performance comparison](https://psychtoolbox.discourse.group/t/serial-port-interface-code-a-performance-comparison/3781)

xiangrui’s RTBox should also work well cross-platform, but I think you already have a LabJack?

---

_[View the full topic](https://psychtoolbox.discourse.group/t/biosemi-usb-trigger-interface-with-psychtoolbox-on-linux/4292)._
