Welcome! Log In Create A New Profile

Advanced

Lever/button task

Posted by Anna_Bert 
Lever/button task
April 06, 2022 05:28AM
Hi,
We are creating "a lever task" in which we need to control both the eye and a lever. Specifically we have two blocks: during block 1 a stimulus(sample) is presented and the subject has to move the lever in one direction (forward); while during block 2, there are no stimuli presented and the subject has to move the lever in the other direction (backward). Our lever generates an analog signal (voltage) with the following values: it starts in the central position with 6 Volt; then it reaches 11 Volt for the forward position and 0 Volt for the backward position. We tried to use the eyejoytrack function to simultaniously monitoring the eye position and the lever status, treating the lever as a button; it does not work for our propose because by indicating the threshold parameter we can just set a threshold value (in Volt) that once exceeded, a lever movement is detected but only for the forward position (since it works in terms of increase of voltage from the threshold). So in order to acquire the backward position we would need to indicate a descrease voltage in respect to the set threshold (<6 Volt, central position). Moreover, we can not use the eyejoystick function because we do not want the joystick trace to be visible on the monitor.
Do you have any suggestion to solve the issue?
Thank you!
Re: Lever/button task
April 06, 2022 09:58AM
Your lever has three states, while a button can have only two states, so the obvious solution is to use the lever as a joystick. See the showcursor function for the joystick cursor control.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#showcursor
Re: Lever/button task
April 09, 2022 03:12AM
We followed your advice and we managed to treat the lever as a joystick and to hide the joystick trace on the monitor, and everything seems to work just fine. So thank you!

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.