Joystick direction as response & RT

Nick ndlange at gmail.com
Thu Feb 4 22:10:26 UTC 2010


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... at 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-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of David McFarlane
> Sent: 02 February 2010 16:28
> To: e-prime at 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
> 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
>
> At 2/2/2010 11:05 AM Tuesday, Nick wrote:
> >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?
>
> >On Feb 1, 3:21 pm, David McFarlane <mcfar... at msu.edu> wrote:
> > > 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
>
> > > >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.
>
> > > >On Feb 1, 11:00 am, liwenna <liwe... at gmail.com> wrote:
> > > > > 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).
>
> > > > > On Feb 1, 5:15 pm, Nick <ndla... at gmail.com> wrote:
>
> > > > > > 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
>
> --
> You received this message because you are subscribed to the Google Groups "E-Prime" group.
> To post to this group, send email to e-prime at googlegroups.com.
> To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
> For more options, visit this group athttp://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.

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



More information about the Eprime mailing list