
Originally Posted by
Charles Linquis
I don't know how fast your ramp needs to be - but..
I would use a timer interrupt - say 1 millisecond
Multiply ramp time (in seconds) X 1000 to get the number of steps
Take
(endvalue - startvalue)/numberofsteps to get step size
Initialize a counter with the start value and increment the step size in each interrupt.
Depending on your needs, you may have to add some extra increments, because the step size will be an integer, and when multiplied by the number of steps may not exactly equal the
end value.
Bookmarks