1 Joystick Drive

From the User Default Code, in the part of one joystick drive we used
only those two lines:

pwm09 = pwm11 = Limit_Mix(2000 + p1_x + p1_y - 127);
pwm10 = pwm12 = Limit_Mix(2000 + p1_x - p1_y + 127);

We want to know the meaninig of the other lines on this part of the code.
And we want to know what the Limit_Mix function is doing?

thanks…

Although i do not know what other code in the part you are talking about, I do know what LimitMax is doing.
As you can see, the number being entered into the function is well over 2000, while the maximum that can be put to the PWM is only 255. What Limit_Max is reduces the input number, and its output is limited to the 0,255 range valid for the PWMs… On my team, we just skipped this and made all numbers signed so we could just add 127 making the range from -127,127, to 0,255… but I would not advise doing this without knowing what you are doing, you may miss something and mess up the entire code.

I spent most of last season fiiguring out a better way to map the one joystick to the wheel speeds. I was please with what we finally created.

I posted a thread on it last March:
http://www.chiefdelphi.com/forums/showthread.php?t=27373&highlight=trentonDrivehttp://www.chiefdelphi.com/forums/showthread.php?t=27373&highlight=trentonDrive

Do yourself a favour and don’t play with limit mix. In our first year (last year) we had no idea what we did, so we removed it in some variations of the code we made…

Some of the junior programmers ended up having the robot with the wrong code (limit mixed removed, among other things). The robot went crazy almost ran over a few people.

Becareful :yikes: