Hi, I’ve been looking over the 2007 default code and making adjustments where necessary; however, I’ve encountered something that doesn’t seem right to me. Under the one-joystick drive section, I see this code:
I haven’t actually downloaded the code to the robot, but it seems like the first two lines would switch the X and Y axes. I made a simple program that allowed me to input joystick values and it gave me the right/left drive values, and it gave me the backwards output I expected. It seems to me like removing those first two lines should solve the problem. Is this normal? Are the axes switched? Should I go ahead and remove those two lines?
hey, that code is assuming that the shaft of the two motors are facing each other…
if you mount your motors with the shafts pointing away from each other then your motors will run backwards (up on joystick means drive backwards, left on joystick causes robot to turn right).
you need to invert the signal in the code to support the motors aligned with shafts facing away.
what does pwm05 have to do with the joystick? on our robot nothing is even plugged into pwm05… why is this part of the single joystick X/Y mixing operation code?