View Single Post
  #1   Spotlight this post!  
Unread 18-01-2005, 21:29
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,277
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
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