Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
suryarajan

Junior Member
Registered:
Posts: 6
Reply with quote  #1 
Hello

I use two eyejoytrack commands with acquiretouch such that once the first one has received an input, it moves on to the next eyejoytrack command within a duration of 10-20 ms after performing certain operations. It seems like the signal from the first button press leaks on to the second eyejoytrack command and immediately terminates the second command as though there was a second button press even though there was not any. The reason why I suspect the signal leaks is because I have two buttons inputs for each of the eyejoytrack commands and the false second button press event code is always the same as the first one.

I tried adding a buffer time of 100ms (using idle) in between the two commands but it doesn't solve the problem completely in that it behaves fine sometimes and it repeats the mistake sometimes.

I have been using only the simulation mode so far to test the code so I don't know if this is a temporal resolution problem with the simulation mode.

Can someone help me out with this?

Thank you

0
Jaewon

Administrator
Registered:
Posts: 689
Reply with quote  #2 
Please post the code you used so that we all can be on the same page.
0
suryarajan

Junior Member
Registered:
Posts: 6
Reply with quote  #3 
Hi Jaewon

Here is the section of the code that I am having trouble with:

 toggleobject(Cue, 'status', 'on', 'eventmarker', Cue_On);

        % Start displaying the cue.

        

        [ontarget rt] = eyejoytrack('acquiretouch', button_left, 4.8, 'acquiretouch', button_right, 4.8, max_cue_duration);

        % starts 'listening' to button presses during the cue display.

        

        if ontarget==0 % this is a no-response condition

            eventmarker(NoResponse_ERROR); 

            toggleobject(Cue, 'status', 'off', 'eventmarker', Cue_Off); % turn off cue

            toggleobject(Fixation_Point, 'status', 'off', 'eventmarker', Fix_Off); % turn off fixation

            eventmarker(post_recording_time_on); 

            [ontarget rt] = eyejoytrack('acquiretouch', button_left, 4.8, 'acquiretouch', button_right, 4.8, post_recording_time);

            % starts 'listening' to button presses during the post-recoding time.

            

            if any(ontarget)~=0 % button pressed during post recording

                eventmarker(LateResponse_ERROR); 

                if ontarget(1)==1 

                    eventmarker(LateResponse_Left_On);

                elseif ontarget(2)==1

                    eventmarker(LateResponse_Right_On);

                end

                % The above if statement terminates the trial if there are

                % any button presses during the post-recording time.

                

            end

            % if not the trial ends after post-recording time.

            

        elseif any(ontarget)~=0 % this is a yes-response condition

            if ontarget(1)==1

                eventmarker(LEFT_Button_On);

            elseif ontarget(2)==1

                eventmarker(RIGHT_Button_On);

            end

            toggleobject(Cue, 'status', 'off', 'eventmarker', Cue_Off); % turn off cue

            toggleobject(Fixation_Point, 'status', 'off', 'eventmarker', Fix_Off);% turn off fixation

            eventmarker(post_recording_time_on);

            % idle(button_buffer_time);
           
            % This needs to be addressed. There seems to be a leakage of button voltage into the

            % post recording time that leads to premature termination of post recording time.

           

            

            [ontarget rt] = eyejoytrack('acquiretouch', button_left, 4.8, 'acquiretouch', button_right, 4.8, post_recording_time);

            % starts 'listening' to button presses during the post-recoding

            

            if any(ontarget)~=0

                eventmarker(LateResponse_ERROR);

                if ontarget(1)==1

                    eventmarker(LateResponse_Left_On);

                elseif ontarget(2)==1

                    eventmarker(LateResponse_Right_On);

                end

                % The above if statement terminates the trial if there are

                % any button presses during the post-recording time.

            end

            % if not the trial ends after post-recording time.

        end

        

    end

    

end

 
0
Jaewon

Administrator
Registered:
Posts: 689
Reply with quote  #4 
Buttons stay ON as long as you hold the press. It is not a leakage or anything like that. Between two 'acquiretouch' calls, you should check if the subject releases the button. Then proceed to the second eyejoytrack only when the button is released.
0
suryarajan

Junior Member
Registered:
Posts: 6
Reply with quote  #5 
I have been testing this code only with the simulation mode in MonkeyLogic and the button is not physically held continuously for a long time. But yes there seems to be a lag in the release of the button upon visual inspection of the simulation mode window.
0
Jaewon

Administrator
Registered:
Posts: 689
Reply with quote  #6 
The simulation mode works exactly in the same way as you would test with real buttons. If you hold down the key for a long time, it is just like holding the button continuously.

In your code, the time that MATLAB would take between the two eyejoytracks is ~ 30ms, I think. So, unless you press the button (or the key) only for that short period of time, both eyejoytracks will be finished with one button press.

If you want to separate them with a "buffer" time, its duration should be at least 1-2 seconds, not 100 ms. 100 ms means that you should press and release at a speed of 10 presses/sec, which I don't think you can do.
0
suryarajan

Junior Member
Registered:
Posts: 6
Reply with quote  #7 
Oh okay got it! Thank you very much Jaewon.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.