Asked
— Edited

So Im trying to use use a slide script. I have the variable setup as $RightPWM. If I want to make another script that uses that variable to set the pwm how would I do that? Aka $RightPWM= 5, I want the pwm to change to 5. How would I do this? If statement? Not sure how I would make it.
Assuming the port is D0 the command would be;
Code:
You will need to make sure $RightPWM is set to something before running the script or command which uses the variable though otherwise it will error as the variable will not exist. I usually add all variables to an init script and set them to 0, this ensures the variables exist and will avoid any scripts failing due to the possibility of an error.
Code:
What is it you are trying to achieve? There may be a better/different method.
Code:
or a WaitForChange() and a GetPWM()
Code:
Either way will work, using a slide script or using a PWM control, I always prefer to use the native controls over scripting when possible, they are there to make things easier.