Joystick using for Approach - Avoidance Task
I have some experience with Opensesame, but I have hardly any coding knowledge or experience. Currently, I'm trying to prepare an approach-avoidance task using the joystick (I've never used joystick before). Although I understand some of the basics of using the joystick while looking at the forum, I still need your support.
In the task, some photos will be presented, and when the participant wants to approach the photo, he/she has to pull the joystick and push forward if he/she wants to avoid it. When the participant pushes or pulls the joystick, the size of the photo should increase or decrease by 20% for every 7% of the joystick movement. When the joystick movement is greater than 30%, the stimulus screen should disappear and the fixation screen should appear.
So far I have done the following; I added a joystick plug in before a sketchpad(0 ms duration) for stimulus presentation. And after the sketchpad, in an inline_script, I added some code from the forum discussions. These codes are as follows;
# Loop until a response is given while True: # Get a joystick movement movement,timestamp = exp.joystick.get_joyaxes() # `movement` is a tuple indicating the horizontal and vertical movement. dy = movement # If there is vertical movement, set the variable `move_joystick` to up or # down, and break the loop. if dy < 0: exp.set('move_joystick', 'up') var.derece = dy break elif dy > 0: exp.set('move_joystick', 'down') var.derece = dy break
When I looked at previous discussions on this, there were some similar questions, but I did not solve some basic problems. Here my questions;
1- What can I do to increase or decrease stimulus size according to joystick movement?
2- How do I set the stimulus presentation time, based on the participant's joystick response? (Fixation screen should come when joystick movement is greater than 30% angle).
- I guess, the solution of this is about 'while loop', but unfortunately, I have no idea how to do that.
3- I want the other buttons on the joystick to be inactive and the only allowed response is to be the joystick movement (Y axis). How can I do that?
- I know all the button numbers except the joystick movement.
I know that the answers to these questions are available under different topics in the forum, but since I don't have coding skills, I have difficulty integrating them into this experiment. Any help would be greatly appreciated!