|
another way
drive_L = ((((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000) * (1 - p1_sw_trig)) + (~(((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000) * p1_sw_trig)
drive_R = ((((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000) * (1 - p1_sw_trig)) + (~(((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000) * p1_sw_trig)
If you want to avoid extra lines and extra variables you can do it this way. Its a bit long but we used it last year and it worked great.
__________________
GodBless America
September 11, 2001... NEVER FORGET!
All Gave Some. Some Gave All. How much are you willing to give?
FDNYPD
|