DylanRoss
17-01-2007, 13:12
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:
p1_x = 255 - p1_y;
p1_y = 255 - pwm05;
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);
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?
Thanks,
Dylan
p1_x = 255 - p1_y;
p1_y = 255 - pwm05;
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);
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?
Thanks,
Dylan