How to assign vibrations to different visual stimuli

OS (e.g. Win10): Mac 12.6.8
PsychoPy version (e.g. 1.84.x): 2024 1.5
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?: Two stimuli presented on screen. One rotates and vibrates for a specific duration, then stops, and then the other rotates and vibrates for a specific (shorter or longer) duration. Response to which vibration was longer then collected by touching visual stimuli.

What did you try to make it work?: Have added in command for vibration into code, but this is not linked with a specific visual stimuli. Command is "navigator.vibrate([1400]); "

What specifically went wrong when you tried that?: It only vibrates once, I can’t figure out how to have two vibrations within the same trial, each associated with a specific visual stimuli.

All help appreciated!

If you wanted it to vibrate twice with 500 milliseconds in between then you could try:

navigator.vibrate([1400,500,700);

Hi wakecarter, thanks for the advice. I need stimuli 1 to move+vibrate and then stimuli 2 to move+vibrate, with a gap in between the two stimuli - so I think I need to associate the vibration with the specific stimuli so they match the movement? Any advice on yoking vibration to a specific stimuli would be much appreciated! Thanks, V.

Use what you know about the start times of when the two stimuli move to tell navigator.vibrate when to start and stop.

Oooh this is a great idea! Thank you! Do you by chance have an example of script for how you specify navigator.vibrate to start/stop? Have not done anything like that before. Thanks, V.