Hisham Abboud of Cedrus says "the code detects button presses and can retrieve the timestamp, but we're currently setting the timestamp to zero because there is some drift in the hardware itself. UPDATE: regarding the below problems, it's possible they're all avoided by using the new code that's since been developed at We trigger a photodetector by drawing on the screen at a known time, and have the photodetector send an event into the box. Retrieve a line triggered event from the box. Print (binary(linesStatus)) #the status of each line, 1 being input, 0 output To get out the data about the button press or release:įormatted_response=unpack('> 1, c) + str(i & 1)) or ): c(i, c) #one-line function to convert to binary format But basically, to check if a key has been pressed or released, you check this: In the attached file that shows how we tested the precision of the box relative to the computer clock, you can see how I did this. To avoid this, you need to record both separately. To reset the button-box internal clock to 0:Ĭritically, the box records both the press and release of the button and sends a signal in exactly the same way (at least how it's set up now). To erase all info in the box about previous button-presses: Then you need these lines at the start of your code: To use the button-box with a python program, we put dipswitches 1 and 2 down so the box used XID (eXperimental Interface Device) communication protocol, which provides timestamps of button press times. the below was written before I saw Jon Pierce has put code supporting the Cedrus in psychopy, but i think his code is vulnerable to the same problems I had all of the little dip switches in back in the down position. I used the driver for their USA-28x product. To work, you must install a driver from the Cedrus website here:, and surprisingly, I also had to install a USB to serial port driver called keyspanUSAdrvr from Tripplite, formerly Keyspan. It connects to the computer via a USB port, and is controlled by the computer as a serial port (or something like that). It is on loan from Nenad and the IT office. The button-box we have used for our "sensorimotor synchronisation" experiments is a Cedrus RB-730 response pad. And there is PsychoPy code available for the Iolabs device. Iolabs device might be better than the Cedrus box detailed below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |