expyriment.io.TriggerInput

class expyriment.io.TriggerInput(interface, default_code=None)

A class implementing a trigger input.

Methods

__init__(interface, default_code=None)

Create a trigger input.

Parameters interface – the interface to use (expyrment.io.SerialPort or

expyriment.io.ParallelPort object)

default_code – the default code of the trigger (int) (optional)

default_code

Getter for default_code

get_triggers(code=None, bitwise_comparison=False)

Get list of received triggers.

For not missing any triggers the history has to be updated regularly (e.g. by calling this method)! Returns None if no history is used.

If bitwise_comparision = True, the function performs a bitwise comparison (logical and) between code and received input and waits until a certain bit pattern is set.

Parameters code – a specific code to get (int) (optional) bitwise_comparison – make a bitwise comparison (default=False)

interface

Getter for interface

logging

Getter for logging.

set_logging(onoff)

Set logging of this object on or off

Parameters :

onoff : bool

set logging on (True) or off (False)

Notes

See also design.experiment.set_log_level fur further information about event logging.

trigger_count

Get the number of received triggers.

For not missing any triggers the history has to be updated regularly (e.g. by calling this method)! Returns None if no history is used.

If bitwise_comparision = True, the function performs a bitwise comparison (logical and) between code and received input and waits until a certain bit pattern is set.

Parameters code – a specific code to count (int) (optional) bitwise_comparison – make a bitwise comparison (default=False)

wait(code=None, bitwise_comparison=False)

Wait for a trigger.

Returns the code received and the reaction time [code, rt].

If bitwise_comparison = True, the function performs a bitwise comparison (logical and) between code and received input and waits until a certain bit pattern is set.

Parameters code – a specific code to wait for (int) (optional) bitwise_comparison – make a bitwise comparison (default=False)

Previous topic

expyriment.io.TouchScreenButtonBox

Next topic

expyriment.misc

This Page