| Reference | Downloads | Github

Invert parallel port signal to communicate with shocker

Hi everybody,

I am using PsychoPy to send Parallel Port signals to a device that sends small electric shocks (DigiTimer). However, the shocker reacts to the beginning of the signal, not to the end of the signal. How is it possible to invert the signal (similar to the invert option in Presentation) ?

port = windll.inpout32
portAddress=0xD010 #LPT3

def TriggerSignal(code):
port.Out32(portAddress, code)
QtTest.QTest.qWait(5) # 5 ms wait
port.Out32(portAddress, 0)

Within code:
TriggerSignal(1) # shocks follows