[visionegg] Re: trigger

alessandra.stella@xxxxxx wrote:

Dear Andrew, What I would need now is to understand how to get two kind of trigger: one
for the gabor on the left and the other for the gabor on the right. Thanks a lot!
Alessandra




Dear Alessandra,

All you need is a little glue to get the parallel port code working with your gabor code. Try adding the following to your script. Bit 0 of the parallel port (pin 2) will switch on and off with one of the gabor's contrast reversal, and bit 1 (pin 3) will follow the other gabor.

Cheers!
Andrew

from VisionEgg.DaqLPT import raw_lpt_module
# constants for parallel port
LPT1 = 0x378 # address of parallel port -- make sure your computer agrees
BIT0 = 0x01 # pin 2 on DB25 connector
BIT1 = 0x02 # pin 3 on DB25 connector

# keep track of what is output on parallel port
bit0_set = False
bit1_set = False

# modify your controller functions like so:

def contrast_controllerds( t ):
   contrast_ds = sin(8.0*2.0*pi*t)
   bit0_set = contrast_ds > 0
   out_value = (bit0_set and BIT0) | (bit1_set and BIT1)
   raw_lpt_module.out(LPT1,out_value)
   return contrast_ds
def contrast_controllersx( t ):
   contrast_sx = sin(5.0*2.0*pi*t)
   bit1_set = contrast_sx > 0
   out_value = (bit0_set and BIT0) | (bit1_set and BIT1)
   raw_lpt_module.out(LPT1,out_value)
   return contrast_sx

--
Andrew D. Straw  Post-doctoral scholar
,-.              Dickinson Lab
\_/              California Institute of Technology
8||}             Mailcode 138-78
/ \              Pasadena CA 91125, USA
`-^
                email:  astraw@xxxxxxxxxxx
                 office: +1 626 395 5828


====================================== The Vision Egg mailing list Archives: http://www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html

Other related posts: