Joystick & Inquisit


Author
Message
Tomek
Tomek
Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Hi,


I'm new user of Inquisit and I need to do an experiment with joystick. I need script which works with joystick (USB). On the screen supposed to be something like this (kind of bar):



When I push joystick, this bar supposed to go up of the screen and when I pull joystick, this bar supposed to go down of the screen. I need effect of distance. If the bar is on the top, it means it's far, it's smaller etc.


With this I need also to count time, which starts when I push/pull joystick and stops when the bar will "touch" the end of screen.


Can anybody help me with this?:)


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

You'll need to change your bar stimulus' position and size based on the <joystick>'s y coordinate (joystick.y). See the Approach Avoidance Task and the Tower of London script available from the Task Library as examples.


However, before delving into these advanced topics, I strongly recommend you work through the various tutorials included in the Inquisit documentation to acquire the basics of Inquisit's syntax and programming model.


Tomek
Tomek
Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Thanks for examples of tasks. It's bit closer but still... I have no idea how to write a script. Maybe somebody have something similar script to my concept?


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

Here's a very simple example using mouse input:


<expressions>
/ size = 100%*(trial.drawbar.responsey/display.height)
/ vpos = 1px*trial.drawbar.responsey
</expressions>

<picture bar>
/ items = ("bar.bmp")
/ size = (expressions.size, expressions.size)
/ hposition = 50%
/ vposition = expressions.vpos
/ erase = false
</picture>

<shape blank>
/ shape = rectangle
/ size = (100%, 100%)
/ color = white
/ erase = false
</shape>

<trial drawbar>
/ stimulusframes = [1=blank, bar]
/ inputdevice = mousekey
/ validresponse = (mousemove)
/ branch = [trial.drawbar]
/ numframes = 1
/ recorddata = false
</trial>

<block myblock>
/ trials = [1=drawbar]
</block>


It is very unlikely that anybody has a script around that exactly matches what you are looking for. Thus you will probably have to get up to speed with Inquisit's syntax and then forge ahead.


Regards,


~Dave


Tomek
Tomek
Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)Associate Member (128 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Dave, thank you:) That's what I was thinking about:) 


Is it easy to you to put there something what can count time of pulling/pushing to the end of screen? I need to do over a dozen experiments for pulling and same for pushing and than I have to compute tha average time of it. Is it easy to do?


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

You'll want to use <values>, <expressions> and properties to do that. Basically, you'll want to read out and store the script.elapsedtime property when you start a trial* and then again when the trial finishes (i.e., when the bar reaches its target position). The difference gives you the latency you are interested in. To see how this is done, work through the Tower of London script which does exactly that.


* Here, a trial consists of multiple <trial> elements, i.e. "trial" is not equal to <trial>.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search