|
Re: Swerve Programming joystick issues
It's difficult without your code to give an exact solution, but something like this should work for determining the best direction to rotate (as discussed above):
(W)heel pos: 350
(J)oystick pos: 10
(W-J)%360 = 340 -> bigger than 180, don't turn negative
(J-W)%360 = 20 -> smaller than or = to 180, turn positive!
|