Vary voltage based on pot value
9 years 7 months ago #29528883
by cdb0ewm
Vary voltage based on pot value was created by cdb0ewm
I trying to vary the voltage to a motor that is controlled by a joystick based on the input of a separate pot. I'm new to this type of scripting. I think I can get this done by using the MXP... commands but I'm seem to be stuck. The code I've written is
top:
SpeedInMax = 50 ' max pot value * 10
SpeedInMin = 0 ' min pot value
SpeedIn = GetValue(_ANAIN,1) * 10 ' actual pot value
Voltset = SpeedInMax + (SpeedInMax * SpeedIn / SpeedInMax) ' set MXP.. between 50 and 100
~MXPF 1 Voltset
Print (Voltset) ' just to check my math
goto top
My confusion is setting the MXP... commands
Any help would be greatly appreciated
top:
SpeedInMax = 50 ' max pot value * 10
SpeedInMin = 0 ' min pot value
SpeedIn = GetValue(_ANAIN,1) * 10 ' actual pot value
Voltset = SpeedInMax + (SpeedInMax * SpeedIn / SpeedInMax) ' set MXP.. between 50 and 100
~MXPF 1 Voltset
Print (Voltset) ' just to check my math
goto top
My confusion is setting the MXP... commands
Any help would be greatly appreciated
Please Log in or Create an account to join the conversation.
- Griffin Baker
9 years 7 months ago #29528884
by Griffin Baker
Replied by Griffin Baker on topic Vary voltage based on pot value
You may want to check and modify one of our sample scripts.
dev.roboteq.com/dev1/index.php/support/downloads
Analog throttle.
dev.roboteq.com/dev1/index.php/support/downloads
Analog throttle.
Please Log in or Create an account to join the conversation.
Time to create page: 0.049 seconds