andrew_4_life
27-03-2008, 20:40
When I load this code, the drive seems to mess up. Going forward and back is fine, but it won't turn to the correct side. When I turn "RIGHT" it turns "LEFT", when I turn "LEFT" it turns "RIGHT"
I've also tried switching the PWN cables but that just really messed up the controls because it was going backwards.
/*---------- Analog Inputs (Joysticks) to PWM Outputs-----------------------
*--------------------------------------------------------------------------
* This maps the joystick axes to specific PWM outputs.
*/
//pwm01 = p1_y;
//pwm02 = p2_y;
pwm03 = p3_y;
pwm04 = p4_y;
pwm05 = p1_x;
pwm06 = p2_x;
pwm07 = p3_x;
pwm08 = p4_x;
pwm09 = p1_wheel;
pwm10 = p2_wheel;
pwm11 = p3_wheel;
pwm12 = p4_wheel;
/*---------- 1 Joystick Drive ---------------------------------------------
p1_x = 255 - p1_y;
p1_y = 255 - pwm05;
pwm01 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = Limit_Mix(2000 + p1_y - p1_x + 127);
We also tried this: (reversing the signs
pwm01 = Limit_Mix(2000 + p1_y - p1_x +127);
pwm02 = Limit_Mix(2000 + p1_y + p1_x - 127);
I've also tried switching the PWN cables but that just really messed up the controls because it was going backwards.
/*---------- Analog Inputs (Joysticks) to PWM Outputs-----------------------
*--------------------------------------------------------------------------
* This maps the joystick axes to specific PWM outputs.
*/
//pwm01 = p1_y;
//pwm02 = p2_y;
pwm03 = p3_y;
pwm04 = p4_y;
pwm05 = p1_x;
pwm06 = p2_x;
pwm07 = p3_x;
pwm08 = p4_x;
pwm09 = p1_wheel;
pwm10 = p2_wheel;
pwm11 = p3_wheel;
pwm12 = p4_wheel;
/*---------- 1 Joystick Drive ---------------------------------------------
p1_x = 255 - p1_y;
p1_y = 255 - pwm05;
pwm01 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = Limit_Mix(2000 + p1_y - p1_x + 127);
We also tried this: (reversing the signs
pwm01 = Limit_Mix(2000 + p1_y - p1_x +127);
pwm02 = Limit_Mix(2000 + p1_y + p1_x - 127);