|
Help with code single joystick
The default code for single joy stick drive is
pwm01 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = Limit_Mix(2000 + p1_y - p1_x + 127);
however with this code our robot turns right when joystick is forward , and goes forward when the joy stick is pushed to the left.
Mathematically
pwm01 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = 254-Limit_Mix(2000 + p1_y + p1_x - 127);
would solve the problem, assuming 254 is the maximum value for the PWM since I dont have the robot with me I can not tell if this will work. Could you please tell me if this will work, if not could you please tell me why or point me in the right direction.
Thank you
James
|