Skip to content
Browse files

sending parallel port signal

updated conditions file with trigger codes for each stimuli and added
the paralllel port clear/send in the MegProsodyAuto.py
  • Loading branch information...
1 parent 4d15b48 commit cc857ad32f83380f9c1b7031200dde12dbc50bbf ctmdev committed Dec 18, 2012
Showing with 14 additions and 0 deletions.
  1. BIN conditionsFiles/Meg_prosody_block1.xlsx
  2. +14 −0 src/MegProsodyAuto.py
View
BIN conditionsFiles/Meg_prosody_block1.xlsx
Binary file not shown.
View
14 src/MegProsodyAuto.py
@@ -14,6 +14,10 @@
from numpy import sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray
from numpy.random import random, randint, normal, shuffle
import os # handy system and path functions
+from psychopy import parallel
+
+parallel.setPortAddress(0x378) #address for parallel port on many machines
+pinNumber = 2 #choose a pin to write
# Store info about the experiment session
expName = 'None' # from the Builder filename that created this script
@@ -190,10 +194,20 @@
# start/stop megStim
#TIMEFIX: added a 0.5 second delay preceeding
if t >= 0.5 and megStim.status == NOT_STARTED:
+ #PARALLEL CLEAR
+ parallel.setData(0) #sets all pins low
+
# keep track of start time/frame for later
megStim.tStart = t # underestimates by a little under one frame
megStim.frameNStart = frameN # exact frame index
megStim.play() # start the sound (it finishes automatically)
+
+ #PARALLEL SET
+ parallel.setData(trigg_code) #sends trigg_code from conditions file
+
+ #PARALLEL CHECK
+ if t >= 0.5 + 0.05 and megStim.status = NOT_STARTED:
+ parallel.setData(0)
#TIMEFIX: changes megStim.status to FINISHED after duration
if t >= stimLength and megStim.status == STARTED:

0 comments on commit cc857ad

Please sign in to comment.
Something went wrong with that request. Please try again.