stimuli.trigger.ParallelPortTrigger🔗

class stimuli.trigger.ParallelPortTrigger(address, port_type=None, delay=10)[source]🔗

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

Parameters:
addressint (hex) | str

The address of the parallel port on the system. If an Arduino to Parallel Port converter is used, the address must be the serial port address or "arduino" for automatic detection.

port_typestr | None

Either 'arduino' or 'pport' depending on the connection. If None, attempts to infers the type of port from the address.

delayint

Delay in milliseconds until which a new trigger cannot be sent. During this time, the pins of the LPT port remain in the same state.

Attributes

address

The address of the parallel port on the system.

delay

Delay (ms) to wait between two signal().

port_type

Type of connection port.

Methods

close()

Disconnect the parallel port.

signal(value)

Send a trigger value.

Notes

The address is specific to the system. Typical parallel port addresses are:

  • On Linux:

    LPT1 = /dev/parport0
    LPT2 = /dev/parport1
    LPT3 = /dev/parport2
    
  • On Windows:

    LPT1 = 0x0378 or 0x03BC
    LPT2 = 0x0278 or 0x0378
    LPT3 = 0x0278
    
  • macOS does not have support for built-in parallel ports.

close()[source]🔗

Disconnect the parallel port.

This method should free the parallel or serial port and let other application or python process use it.

signal(value)[source]🔗

Send a trigger value.

Parameters:
valueint

Value of the trigger, between 1 and 255.

property address🔗

The address of the parallel port on the system.

Type:

int | str

property delay🔗

Delay (ms) to wait between two signal().

Type:

float

property port_type🔗

Type of connection port.

Type:

str