I have a variable that changes from 0 - 127. And I would like an option to set a step size so that it increases by 2's or 3's etc.
I guess it is an easy problem, but I can't work it out. It is to occur in an interrupt, so no loops. On a single pass it must be determined whether the value is between an upper and lower boundary, such as 0 - 9 for a step size of 10, and then display the lower boundary of zero. Or if it is within the next step, 10 - 19, then display the lower boundary of ten. etc