Performing calculations and a series of reads in a row is your major prob. Here's an idea - (pseudo code):
#1:
define prev_value vars
Loop:
for i = 1 to 4
read one pot (based on i)
check to see if it changed (compared to a previously saved value)
if changed, calc new value
pulse_out each of your motors
next i
goto loop
This way you're only doing one A/D read per loop, and only doing the math when the value of the pot changes (multiplication and (even more so) division are clock cycle suckers!
------------------
#2: do away with the gosubs in speed-critical situations. In-line code is harder to read, but faster
Regards,
Bookmarks