Changes

Jump to navigation Jump to search
49 bytes removed ,  11:27, 12 March 2014
no edit summary
Line 22: Line 22:     
== Psychopy Settings ==
 
== Psychopy Settings ==
<nowiki>
  −
#!/usr/bin/env python
     −
from psychopy import core, visual, event from rusocsci import buttonbox import logging, time
+
<nowiki>
 +
#!/usr/bin/env python
   −
##Setup Section
+
from psychopy import core, visual, event from rusocsci import buttonbox import logging, time
#logging.getLogger().setLevel(logging.DEBUG) # use this for debug info
     −
win = visual.Window([400,300], monitor="testMonitor") bb = buttonbox.Buttonbox()
+
##Setup Section
 +
#logging.getLogger().setLevel(logging.DEBUG) # use this for debug info
   −
##Experiment Section
+
win = visual.Window([400,300], monitor="testMonitor") bb = buttonbox.Buttonbox()
   −
b = bb.waitButtons(maxWait = 10.0, buttonList=['A']) print("b: {}".format(b))
+
##Experiment Section
   −
##Cleanup Section
+
b = bb.waitButtons(maxWait = 10.0, buttonList=['A']) print("b: {}".format(b))
   −
core.quit() The following script lights the LEDs under the buttons pressed.
+
##Cleanup Section
   −
#!/usr/bin/env python
+
core.quit() The following script lights the LEDs under the buttons pressed.
#from __future__ import print_function
     −
import logging, time, sys from rusocsci import buttonbox
+
#!/usr/bin/env python
 +
#from __future__ import print_function
   −
##Setup Section
+
import logging, time, sys from rusocsci import buttonbox
   −
led = [False]*8
+
##Setup Section
   −
##Experiment Section
+
led = [False]*8
   −
bb = buttonbox.Buttonbox() while True:
+
##Experiment Section
   −
    buttons = bb.getButtons()
+
bb = buttonbox.Buttonbox() while True:
  if len(buttons):
+
 
      for c in buttons:
+
  buttons = bb.getButtons()
          if ord(c) >= ord('a') and ord(c) < ord('a')+8:
+
  if len(buttons):
              led[ord(c) - ord('a')] = False
+
  for c in buttons:
          elif ord(c) >= ord('A') and ord(c) < ord('A')+8:
+
  if ord(c) >= ord('a') and ord(c) < ord('a')+8:
              led[ord(c) - ord('A')] = True
+
  led[ord(c) - ord('a')] = False
      bb.setLeds(led)
+
  elif ord(c) >= ord('A') and ord(c) < ord('A')+8:
      #print("buttons ({:3d}): {}{}".format(len(buttons), buttons, " "*50), end="\r")
+
  led[ord(c) - ord('A')] = True
      #sys.stdout.flush()</nowiki>
+
  bb.setLeds(led)
 +
  #print("buttons ({:3d}): {}{}".format(len(buttons), buttons, " "*50), end="\r")
 +
  #sys.stdout.flush()</nowiki>
    
== Matlab Settings ==
 
== Matlab Settings ==

Navigation menu