Trigger🔗

To mark events in time during an experiment, you can use triggers. For instance, you can mark the onset of a sound. The triggers defined in stimuli uses one byte to encode the trigger value, i.e. the trigger value must be between 1 and 255 (except for the LSLTrigger which uses a trigger value between 1 and 127).

MockTrigger()

Mock trigger class.

LSLTrigger(name)

Trigger sending values on an LSL outlet.

ParallelPortTrigger(address[, port_type, delay])

Trigger using a parallel port (also called LPT port).

Example usage:

from stimuli.trigger import ParallelPortTrigger

trigger = ParallelPortTrigger("/dev/parport0")
trigger.signal(1)  # send trigger value 1

Arduino to Parallel Port converter🔗

Parallel ports are less and less common on computers, and are not supported by macOS. Instead, the Fondation Campus Biotech Geneva developed a USB to parallel port converter using an arduino.

The details can be found on this repository: https://github.com/fcbg-platforms/arduino-trigger

This converter can be used with the ParallelPortTrigger class by specifying the path to the serial port connected to the arduino or by using the str "arduino" for automatic detection.