|
This is our motor/acceleration code from last year. It limits the maximum change in the motor values to MAX_ACC per every loop.
SAFE_ZONE CON 1000
MAX_ACC CON 10
MAX_ACC_VAL CON SAFE_ZONE + MAX_ACC
MIN_ACC_VAL CON SAFE_ZONE - MAX_ACC
speed_l = speed_l + (((p1_y - speed_l + SAFE_ZONE) min MIN_ACC_VAL max MAX_ACC_VAL) - SAFE_ZONE)
Modify it as you wish. This will accomplish tasks 1 and 3. speed_l is the speed of the left motor. Replace p1_y with your desired left motor value.
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.
Last edited by Jnadke : 14-02-2003 at 09:41.
|