Previous topic

joystick (pyglet and pygame)

Next topic

Minolta

This Page

Quick links

labjacks (USB I/O devices)

PsychoPy provides an interface to the labjack U3 class with a couple of minor additions.

This is accessible by:

from psychopy.hardware.labjacks import U3

Except for the additional setdata function the U3 class operates exactly as that in the U3 library that labjack provides, documented here:

http://labjack.com/support/labjackpython

Note

To use labjack devices you do need also to install the driver software described on the page above

class psychopy.hardware.labjacks.U3(debug=False, autoOpen=True, **kargs)

Name: U3.__init__(debug = False, autoOpen = True, **openArgs)

Args: debug, enables debug output
autoOpen, if true, the class will try to open a U3 using openArgs **openArgs, the arguments to pass to the open call. See U3.open()
Desc: Instantiates a new U3 object. If autoOpen == True, then it will
also open a U3.

Examples: Simplest: >>> import u3 >>> d = u3.U3()

For debug output: >>> import u3 >>> d = u3.U3(debug = True)

To open a U3 with Local ID = 2: >>> import u3 >>> d = u3.U3(localId = 2)

setData(byte, endian='big', address=6701)

Write 1 byte of data to the U3 port

parameters:

  • byte: the value to write (must be an integer 0:255)

  • endian: [‘big’ or ‘small’] ignored from 1.84 onwards; automatic?

  • address: the memory address to send the byte to
    • 6700 = FIO
    • 6701 (default) = EIO (the DB15 connector)
    • 6702 = CIO