fORP fibre optic (MR-compatible) response devices by CurrentDesigns: http://www.curdes.com/ This class is only useful when the fORP is connected via the serial port.
If you’re connecting via USB, just treat it like a standard keyboard.
E.g., use a Keyboard component, and typically listen for Allowed keys
'1', '2', '3', '4', '5'
. Or use event.getKeys()
.
psychopy.hardware.forp.
ButtonBox
(serialPort=1, baudrate=19200)¶Serial line interface to the fORP MRI response box.
To use this object class, select the box use setting serialPort, and connect the serial line. To emulate key presses with a serial connection, use getEvents(asKeys=True) (e.g., to be able to use a RatingScale object during scanning). Alternatively connect the USB cable and use fORP to emulate a keyboard.
fORP sends characters at 800Hz, so you should check the buffer frequently. Also note that the trigger event numpy the fORP is typically extremely short (occurs for a single 800Hz epoch).
Parameters: |
|
---|
clearBuffer
()¶Empty the input buffer of all characters
clearStatus
()¶Resets the pressed statuses, so getEvents will return pressed buttons, even if they were already pressed in the last call.
getEvents
(returnRaw=False, asKeys=False, allowRepeats=False)¶Returns a list of unique events (one event per button pressed) and also stores a copy of the full list of events since last getEvents() (stored as ForpBox.rawEvts)
getUniqueEvents
(fullEvts=False)¶Returns a Python set of the unique (unordered) events of either a list given or the current rawEvts buffer