# This Zanscript demonstrates how to use the motor commands on the MWP unit (with a built-in motor) to create a vibration. # This is a sample script that illustrates how zanscript can be written to run an experiment and deliver some example data. Zantiks Ltd cannot guarantee # this is how you want to run your experiments, this script is offered only to demonstrate the capabilities of the system and assist you in learning how # to script for your research. DEFINE NUM_TIMES 2 DEFINE WAIT_TIME 3 ACTION MAIN INVOKE(SAMPLE_VIBRATIONS,NUM_TIMES) COMPLETE ACTION SAMPLE_VIBRATIONS # The command for controlling the motor has a number of parameters which can be edited for high stimuli control. # 'M' Number of Motor steps # 'D' Delay between motor steps (to set motor speed) # 'U' Step mode (0-3, for full/half/quarter/eighth step modes) # 'P' Pause, to set delay between motor movements (milliseconds) # The following motor commands adjust the step size to reduce the strength of the vibration. M10 turns the motor 10 steps. ZCOMMAND("U0 D1000 M10 M-10") WAIT(WAIT_TIME) ZCOMMAND("U1 D1000 M10 M-10") WAIT(WAIT_TIME) ZCOMMAND("U2 D1000 M10 M-10") WAIT(WAIT_TIME) ZCOMMAND("U3 D1000 M10 M-10") WAIT(WAIT_TIME) # The following motor commands adjust the step size as before but also show an alternative way of writing the number of steps # Using M1 M-1 turns the motor 1 step in one direction and 1 step back 10 times. This can provide a smoother vibration if using a high M value ZCOMMAND("U0 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") WAIT(WAIT_TIME) ZCOMMAND("U1 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") WAIT(WAIT_TIME) ZCOMMAND("U2 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") WAIT(WAIT_TIME) ZCOMMAND("U3 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") WAIT(WAIT_TIME) COMPLETE