If you do not intend running any tasks in the background while doing the acc/deceleration, the following idea may work
Here the Time variable is specified in seconds.Code:Rate = ((Max-Min) *1000)/ Time ' the 1000 is since I assume a mS time base
Now, using a 1mS time base, you can do this
Rate could be -ve to decelerate.Code:for x = 0 to rate Output = Output + Rate ' increase the output by a fraction we calculated pause 1 ' this is the 1mS time base I talked of next
Bookmarks