![]() |
Inverting Joysticks?
The electrical guys and i have wired the robot and everything. All the wiring is pretty neat and tidy, but we have a problem.... we have 2 right handed transmissions and need to invert one of our joysticks.
I was just wondering what i would do in the code to invert the joysticks. Any and all help or ideas would be greatly appreciated. **we dont wanna rewire anything, we would like to change the code |
Re: Inverting Joysticks?
It is very easy to just swap the wires on the motor side of the victor. If you want to do it in the program, replace all your pwm values with
Code:
254-whateveryoucurrentlyhave |
Re: Inverting Joysticks?
we only need it switched for one joystick.....will doing 254 - whatever really invert, or is there a command to invert it?
|
Re: Inverting Joysticks?
joystickvar = 254 - joystickvar;
That's all you need. |
Re: Inverting Joysticks?
Quote:
Quote:
|
Re: Inverting Joysticks?
Wow I didn't think of it being as easy as 254-p1_y.......
I came up with 127-(p1_y-127) which essentially does the same thing... I think to much... |
| All times are GMT -5. The time now is 01:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi