Joystick direction as response & RT

497 views
Skip to first unread message

Nick

unread,
Feb 1, 2010, 11:15:54 AM2/1/10
to E-Prime
Hi everybody,

I am trying to interface a Logitech Attack3 joystick with E-Prime. So
far I have only had limited success although I think it should be
pretty simple to do what I need.

On each trial, the participants will have to respond to the final
slide with a forward or backward movement of the joystick (depending
on the trial type). All I need is 1) for E-Prime to record the
Reaction Time of when the the push or pull of the joystick is
initiated (in correspondence to the onset of the final slide for each
trial) and 2) for the direction (up or down) of the first joystick
movement to be recorded to the data file.

It seems like this should be pretty standard, but I can't find any
code that addresses it. Is there some code you might know of to do
this type of thing?

Also, I did read through previous posts attempting to solve this
problem with continuous sampling of the joystick X-Y coordinates, but
I couldn't get the posted code to work out. Although I don't like
this solution quite as much for my purposes, any help with how to
continuously sample the X-Y coordinates would also be very
appreciated.

Thanks!
Nick

liwenna

unread,
Feb 1, 2010, 12:00:21 PM2/1/10
to E-Prime
I hope you can forgive me if this is is a really silly question but:
did you add a 'joystick' to the devices in the experiment properties?
(e-prime logo at the top of your experiment tree).

Nick

unread,
Feb 1, 2010, 3:02:01 PM2/1/10
to E-Prime
I can certainly forgive it, but unfortunately that's not the problem.
I can get E-Prime to recognize the joystick and record certain
responses (e.g. button click and concomitant RT), but I can't get it
to record the direction of first movement and the RT of that response.

liwenna

unread,
Feb 1, 2010, 4:08:39 PM2/1/10
to E-Prime
Thanks for forgiving me.

Unfortunately that's also where my knowledge in implementing joysticks
ends...
I hope with you that someone else knows the trick.

David McFarlane

unread,
Feb 1, 2010, 4:21:29 PM2/1/10
to e-p...@googlegroups.com
This old geezer cannot quite resist chiming in with some useless
thoughts. If I only wanted to detect when a subject pushed a
joystick forward or backward (and not how far or fast), then I would
go to eBay and purchase a simple old four- or eight-position Atari or
Commodore style joystick, or even better, an arcade game joystick
that used good quality micro switches. These gave simple off-on
switch closures when the user pushed the stick to a side or
corner. Then I would build a custom cable to go from the appropriate
switches directly to an old parallel printer port or an added digital
I/O card. Then in E-Prime I would use the Port device, or the
ReadPort function from script.

Ah for the days when the electronics were laid bare and the operating
system got out of our way...

-- David McFarlane, Professional Faultfinder

Nick

unread,
Feb 2, 2010, 11:05:16 AM2/2/10
to E-Prime
Hi David,

Thanks for the interesting suggestion. I think we're kinda locked
into trying to figure something out with the existing joysticks we
have before buying other equipment though. Also, I am not so sure that
I could pull off the the custom cable and connections in the near
future having never done anything like that before. The frustrating
thing is that my colleague and I have our procedure ready to go except
for this data recording issue. Would you have any suggestion of in-
line script that might be able to accomplish the recording of first
direction & RT by any chance?

David McFarlane

unread,
Feb 2, 2010, 11:27:39 AM2/2/10
to e-p...@googlegroups.com
Nick,

Fair question, and sadly the answer is no, I have not yet had any
experience whatsoever with modern joysticks in E-Prime. And if the
past is any guide, my saying that means that, almost certainly, one
of the labs here is just about to bring me such a project...

But hey, as I keep saying, that's what PST Web Support is for, so
please contact them post haste at
http://support.pstnet.com/e%2Dprime/support/login.asp , they strive
to respond to all requests in 24-48 hours. And if you do get an
answer from PST Web Support, please do us all the favor of posting
their reply back here.

Regards,


-- David McFarlane, Professional Faultfinder

Michiel Spape

unread,
Feb 3, 2010, 6:19:10 AM2/3/10
to e-p...@googlegroups.com
Hi,
Well - I do actually have script that gets you to run an XBOX-360 controller (convenient, because they connect using USB and Microsoft tends to release source-code for drivers of such things) on one computer which then connects with a serial cable to another one running E-Prime? It's even able to send continuous data from the various buttons and sticks on the XBOX, AND can receive commands to make it vibrate! Groovy!
Best,
Mich

Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology

Nick,

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-p...@googlegroups.com.
To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Nick

unread,
Feb 4, 2010, 5:10:26 PM2/4/10
to E-Prime
Hi All,

Below is the great solution I received from E-Prime support. Does
exactly what I need it to, I hope it helps others as well.

If you do not want subjects to press a button after moving the
joystick to the desired position, you can simply access the cursor
position directly instead of checking for a button press. This means
that you should set the Duration of Stimulus to zero so that the
script can be processed immediately; for an example of this method,
please see SAMPLE:Process Responses Template. By constantly checking
the Y position of the cursor, you can determine whether the subject
has responded. Here is an example of the script to use:

Dim nInitY As Integer
Dim nCurrentY As Integer
Dim nDiff As Integer

nInitY = Joystick.CursorY

Do
nCurrentY = Joystick.CursorY
nDiff = nInitY - nCurrentY

Loop Until Abs(nDiff) > 50

Stimulus.RTTime = Clock.Read
Stimulus.RT = Stimulus.RTTime - Stimulus.OnsetTime

If nDiff > 0 Then
Stimulus.RESP = "Up"
Else
Stimulus.RESP = "Down"
End If

On Feb 3, 5:19 am, Michiel Spape <Michiel.Sp...@nottingham.ac.uk>
wrote:


> Hi,
> Well - I do actually have script that gets you to run an XBOX-360 controller (convenient, because they connect using USB and Microsoft tends to release source-code for drivers of such things) on one computer which then connects with a serial cable to another one running E-Prime? It's even able to send continuous data from the various buttons and sticks on the XBOX, AND can receive commands to make it vibrate! Groovy!
> Best,
> Mich
>
> Michiel Spapé
> Research Fellow
> Perception & Action group
> University of Nottingham
> School of Psychology
>
> -----Original Message-----
> From: e-p...@googlegroups.com [mailto:e-p...@googlegroups.com] On Behalf Of David McFarlane
> Sent: 02 February 2010 16:28
> To: e-p...@googlegroups.com
> Subject: Re: Joystick direction as response & RT
>
> Nick,
>
> Fair question, and sadly the answer is no, I have not yet had any
> experience whatsoever with modern joysticks in E-Prime.  And if the
> past is any guide, my saying that means that, almost certainly, one
> of the labs here is just about to bring me such a project...
>
> But hey, as I keep saying, that's what PST Web Support is for, so

> please contact them post haste athttp://support.pstnet.com/e%2Dprime/support/login.asp, they strive

> For more options, visit this group athttp://groups.google.com/group/e-prime?hl=en.

Reply all
Reply to author
Forward
0 new messages