Welcome! Log In Create A New Profile

Advanced

Time-dependent control of TaskObject with Timing Script v2

Posted by momoyuki 
Time-dependent control of TaskObject with Timing Script v2
April 26, 2022 04:35PM
Hello,

I want to check the release of a pressed button using the WaitThenHold adapter.
During the HoldTime of this adapter, I also want to present one TaskObject for a short time (ex. 200 msec) and switch the presenting object to a set of other TaskObject during the rest of HoldTime.
Here is an example of the task structure: The subject looks at a screen with two TaskObject that appear to be dim circles. These represent the two potential targets. One of the targets will then flash brightly as a visual go cue, before turning off again after 200 msec. It will revert back to the dim color. Then the subject can reach for the target.
I thought I can do this by using the OnOffGraphic adapter, but I cannot figure out how to control the on and off state by the time.
Are there any good sample codes to learn about time-dependent control of TaskObject?

Thank you
Re: Time-dependent control of TaskObject with Timing Script v2
April 27, 2022 06:19PM
OnOffGraphic cannot be used, since its on/off state is not controlled by the time as you already know. And you do not need "TaskObjects" when programming with adapters.

Try the attached example. If it does not work as shown in the video file, update NIMH ML.
Attachments:
open | download - blinking_target.txt (151 bytes)
open | download - blinking_target.m (2.5 KB)
open | download - trial.mp4 (47 KB)
Re: Time-dependent control of TaskObject with Timing Script v2
April 29, 2022 10:35AM
Hi Jaewon,

Thank you for the example code. This code helps me a lot.
I missed the example code for the Sequential adapter and did not realize how to use the TimeCounter adapter.

In the example for the RewardScheduler adapter, the TimeCounter adapter is used as the most child adapter, and it references no adapter. Does this TimeCounter adapter force the scene to continue for a specific period of time?
Re: Time-dependent control of TaskObject with Timing Script v2
April 29, 2022 11:36AM
Yes, that is what the TimeCounter does there.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.