program to use motor with acceleration