expyfun.ParallelTrigger#
- class expyfun.ParallelTrigger(mode='dummy', address=None, trigger_duration=0.01, ec=None, verbose=None)[source]#
Parallel port and dummy triggering support.
Warning
When using the parallel port, calling
expyfun.ExperimentController.start_stimulus()
will automatically invoke a stamping of the 1 trigger, which will in turn cause a delay equal to that oftrigger_duration
. This can effect e.g.EyelinkController
timing.- Parameters:
- modestr
‘parallel’ for real use. ‘dummy’, passes all calls.
- addressstr | int | None
The address to use. On Linux this should be a string path like
'/dev/parport0'
(equivalent to None), on Windows it should be an integer address like888
or0x378
(equivalent to None). The config variableTRIGGER_ADDRESS
can be used to set this permanently.- trigger_durationfloat
Amount of time (seconds) to leave the trigger high whenever sending a trigger.
- ecinstance of ExperimentController
The ExperimentController.
- verbosebool, str, int, or None
If not None, override default verbose level.
Methods
close
()Release hardware interfaces.
stamp_triggers
(triggers[, delay, ...])Stamp a list of triggers with a given inter-trigger delay.
Notes
Parallel port activation is enabled by using the
trigger_controller
argument ofexpyfun.ExperimentController
.- stamp_triggers(triggers, delay=None, wait_for_last=True, is_trial_id=False)[source]#
Stamp a list of triggers with a given inter-trigger delay.
- Parameters:
- triggerslist
No input checking is done, so ensure triggers is a list, with each entry an integer with fewer than 8 bits (max 255).
- delayfloat | None
The inter-trigger-onset delay (includes “on” time). If None, will use twice the trigger duration (50% duty cycle).
- wait_for_lastbool
If True, wait for last trigger to be stamped before returning.
- is_trial_idbool
No effect for this trigger controller.