Is there any easy way to invert one joystick axis in arcade mode?
We just got a USB-Chicklet and a Logitech Dual Action Gamepad. Our code uses arcade mode and works perfectly with the joystick from the kit of parts. Unfortunately, the chicklet inverts the x-axis of the gamepad’s joystick.
We do not want to change the direction the robot drives.
The only way I know how to work around this problem is to rewrite the arcade function (using the default MPLab 1-joystick drive code as a model). Our rookie programmer won’t have time to do that.
Not quite. None of the modes for the Chicklet use the “aux” analog input for a real axis, they use them for encoding buttons. So, if no buttons are pressed p1_aux (or whatever port you’re using) should be larger than 127 all the time if you are using the chicklet. So do a check for that, and if p1_aux is significantly greater than 127, switch the X axis.
I’ve considered something similar to make sure nothing goes weird if our chicklet is malfunctioning.
Not that unless you’re in your fix-it window, you shouldn’t be coding right now, however.
Our programmer switched the left and right motors in the Arcade block and solved the problem. Unfortunately, we have to reprogram if we want to use the KOP joystick. Thanks for all your help.