James, IMHO your best bet is using PID, "Master" Henrik Olsson have a neat routine in this post: http://www.picbasic.co.uk/forum/show...ghlight=incpid
You should give it a try.

Regards.
Ivan.