
Hi guys.
I have some servos set up with joystick buttons and using control command, I have set up some sound effects from a soundboard to play when the buttons are pressed and servos move. Works great.
Here's the thing. I have a servo set up and controlled by joystick 2. What I would also like to do is to play a sound effect I have on the soundboard when this servo is moved, but joystick 2 doesn't have a scripting option on it's configuration menu like the buttons do. Bare in mind I'm still really new and inexperience at using scripts, how do I accomplished this? *confused*
Cheers,
Steve.
Create new EZ-Script Control and use this code...
Code:
When the new EZ-Script Control with the above code is running, it will loop for ever until STOPPED. The code will check for the joystick position and play a sound according to it's location. You can monitor the variable values for the different joystick positions by looking at the VARIABLE tab when editing scripts.
One, a loop with WaitForChange...
Code:
Two, a loop with IF for specific position based control...
Code:
Or use the joystick variables (you must enable them in the joystick control)
Code:
If you are using the same joystick as the Movement Panel and you want sounds when moving forwards, reverse or turning you can use the custom Movement Panel and script the directions in there which can include any controlcommands you need.
Thanks also to Rich for your reply. Yes DJ just picked you to the post, but your help will also come in useful and of course greatly appreciated.
Steve.
This is why you will always notice a Sleep() in every loop that anyone will share.
Thanks again.